• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

PHP echo is outputted in wrong order ?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › PHP echo is outputted in wrong order ?

This topic is: resolved

Tagged: echo, entry-meta, first, order, output, php, text, wrong

  • This topic has 6 replies, 2 voices, and was last updated 7 years, 10 months ago by Matus.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • July 15, 2017 at 10:54 am #209146
    Matus
    Member

    I have a custom written PHP snippet which removes default entry meta text above post and then output custom one.

    This is my code:

    remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
    add_action('genesis_entry_header', 'custom_entry_meta');
    function custom_entry_meta() {
    if ( ! is_singular( 'post' ) & ! is_category('') & ! is_home() ) return;
    	?>
    		<p class="entry-meta">
    			<?php echo "THIS SHOULD BE FIRST"; ?>
    			<span class="entry-avatar">
    				<?php echo get_avatar(get_the_author_meta('email'), 30); ?>
    			</span>
    			<span class="entry-author">
    				<?php the_author_posts_link(); ?>
    			</span>
    			<span class="entry-time">
    				<?php echo $pfx_date = get_the_date( $format, $post_id ); ?>
    			</span>
    			<span class="entry-categories">
    				<?php the_category( ' ' ); ?>
    			</span>
    		</p>
    	<?php
    }

    I'd like to display the echo values in the exact same order as it is written above.

    The only echo script which isn't outputted at the right place is the first one (with the text "THIS SHOULD BE FIRST").

    How can I make that echo which shows text "THIS SHOULD BE FIRST" be outputted as first?

    July 15, 2017 at 11:09 am #209147
    Victor Font
    Moderator

    It would help if you posted a link to a page that is using the script.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 15, 2017 at 11:38 am #209152
    Matus
    Member
    This reply has been marked as private.
    July 15, 2017 at 12:08 pm #209158
    Victor Font
    Moderator

    Nobody can read private replies except forum moderators.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 15, 2017 at 12:24 pm #209159
    Matus
    Member

    Ah, I didn't know that 🙂

    This is what I wrote you:

    I created a new test user for you (my website is in maintenance mode).
    Login page
    Username: studiopress
    Password: forum123Test

    Also my website is in slovak language - WP admin is in english, so as instructions.
    All you need to do after you login:
    1. go to the homepage
    2. Look at the first post

    I wrote you there some details ?

    July 15, 2017 at 2:23 pm #209161
    Victor Font
    Moderator

    Your content is outputting exactly as written in your plugin. If you examine the generated source code with your browser's inspect tool, you can see that the code is correct. https://victorfont.com/how-to-use-your-browsers-inspect-tool/

    The reason why the avatar is displaying in front of the first echo is because the avatar has a float:left in CSS. Float left pushes the avatar in front of everything else. All you need to do is fix the css.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    July 17, 2017 at 1:47 am #209200
    Matus
    Member

    Thanks.

    Adding this CSS code fixed the problem:

    .avatar {
    float:none;
    }
  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble