• 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

Losing all author_info when moving genesis_post_info

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 › Design Tips and Tricks › Losing all author_info when moving genesis_post_info

This topic is: resolved

Tagged: genesis_post_info, missing author

  • This topic has 4 replies, 2 voices, and was last updated 12 years ago by Brad Dalton.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • May 29, 2014 at 1:59 pm #107352
    Stefsull
    Member

    I'm using the Genesis Sample theme as a starting point along with Genesis HTML5 version. I've troubleshot this every way I can think of with no joy. I turn to you good people for further thoughts and ideas. I'll make this as clear as possible:

    I'm trying to move my post info into a custom area after the header. Everything works fine except when adding the post_info back in (whether I filter the portions shown or not) the author_info is blank. Here's what I know...

    If I don't remove the genesis_post_info from the default area in the theme (allowing it to be in both places), the default area still shows the author (and my filter removing comments/edit works). But the area I've added it back in to is missing the author. Here's an image of that: http://screencast.com/t/wxfz4ZWhOmV

    I can create a filter and have the edit, time, comments, etc show up. Just not any of the three author shortcodes. (For the sake of troubleshooting, I removed any filtering for now.)

    Once I remove the genesis_post_info, anywhere I add it back (whether it's in my original function or in an entirely new one by itself), the author is missing.

    Here is my code:

    //* Relocate Post Title and Post Info
    add_action( 'genesis_after_header', 'sk_relocate_post_title_info' );
    function sk_relocate_post_title_info() {
     
      if ( is_singular('post' ) ) {
     
        remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
        remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
        remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
     
        echo '<div class="featured-single"><div class="wrap">';
          genesis_entry_header_markup_open();
          genesis_do_post_title();
          genesis_post_info();
          genesis_entry_header_markup_close();
        echo '</div></div>';
     
      }
    }

    I've boiled this down as much as possible. I've removed every piece of the function one by one... put the genesis_post_info(); into a separate function... etc. All methods remove the author when the post_info is reapplied.

    I can't link to the page since it's on my staging server, but all you'd see on inspection is empty author markup... all markup appears, but the text with the author's name does not.

    Any thoughts? Halp?

    May 29, 2014 at 2:29 pm #107360
    Brad Dalton
    Participant

    Yes because you can't use the get_the_author tag outside the loop.

    You will need to use another author tag, not this one.

     <?php $author = get_the_author(); ?> 
    

    Retrieve the post author. This tag must be used within The Loop.
    Ref http://codex.wordpress.org/Function_Reference/get_the_author

    If you look in genesis > lib > shortcodes > post.php you'll find these tags:

    $author = get_the_author();
    $url    = get_author_posts_url( get_the_author_meta( 'ID' ) );
    

    Rebuild these shortcodes in your child theme with tags that work outside the loop and it will work.


    Tutorials for StudioPress Themes.

    May 29, 2014 at 2:39 pm #107361
    Stefsull
    Member

    On it, Brad! I had no way to verbalize it since this is not my expertise, but I told my husband (also a developer) that it <b>must</b> be due to it not being "allowed" for some reason where it is. Thank you so much for the lifeline...

    May 29, 2014 at 3:55 pm #107369
    Stefsull
    Member

    OK. For those following along at home (or running into this at a later date), after googling to figure out how to do what Brad described above, I found a great code snippet from someone who already did exactly what I needed. Thank you generous people for sharing! If you need to create a new shortcode to get the post author info to use outside The Loop, it's here:

    http://ahjira.com/genesis-post-author-short-code-does-not-work-outside-the-loop/

    (And thanks again for pointing me in the right direction, @braddalton.)

    May 30, 2014 at 12:04 am #107424
    Brad Dalton
    Participant

    Another option if you want to create your own shortcode:

    1. grab the code from Genesis
    2. rename the function
    3. rename the shortcode
    4. rename the filter
    5. replace the author tags with the ones which work outside the loop

    Pretty much what Susanne did but you could also do it differently based on what you want to link to.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ 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

© 2026 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