• 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

Author box

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 › Author box

This topic is: not resolved

Tagged: archive, authorbox author box

  • This topic has 3 replies, 3 voices, and was last updated 13 years, 9 months ago by Gary Jones.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • December 6, 2012 at 10:09 am #3584
    tommeyboy
    Member

    I'm running the magazine theme and want to customize the author box a bit.  I have tried using this code in functions.php, but it's causing the box to display multiple times.  Any idea how to fix?

    /** Add Custom Author Box **/

    //add_action('genesis_after_post_content', 'custom_author_box');
    //
    // function custom_author_box() {
    // if ( get_post_type() == "post" && is_single() && ! ( is_category() || is_tag() ) ) {
    // echo '<div class="author-box">'
    // . get_avatar( get_the_author_id() , 100 )
    // . '<h2>' . '<a href="' . get_author_posts_url(get_the_author_meta( 'ID' )) . '">' . get_the_author() . '</a>' . '</h2>'
    // . '<p>' . get_the_author_meta( 'description', $userID ) . '</p>'
    // . '<div class="author-box-links">' . '<a class="author-archive-link" href="' . get_author_posts_url(get_the_author_meta( 'ID' )) . '">' . 'View all posts from ' . get_the_author() . '</a>'
    // . '</div>'
    // . '</div>';
    // }
    // }
    //
    //add_action('genesis_before_post', 'custom_author_box_archive');
    //
    // function custom_author_box_archive() {
    // if ( is_author && is_archive() && ! ( is_category() || is_tag() ) ) {
    // echo '<div class="author-box">'
    // . get_avatar( get_the_author_id() , 100 )
    // . '<h2>' . get_the_author() . '</h2>'
    // . '<p>' . get_the_author_meta( 'description', $userID ) . '</p>'
    // . '<div class="author-box-links">'
    // . '<a class="author-archive-link" href="' . get_author_posts_url(get_the_author_meta( 'ID' )) . '">' . 'View all posts from ' . get_the_author() . '</a>'
    // . '</div>'
    // . '</div>';
    // }
    // }

     

     

     

    January 12, 2013 at 12:53 pm #11482
    ramseyp
    Member

    Hi there,

    On single posts, are you seeing the author box appear multiple times? On my test, it works correctly on single posts. The code you have in the function custom_author_box_archive() looks problematic. Your conditional is too complicated. Are you wanting it to work only on author archives? If so, why not use:

    if ( is_author() ) { ... }

    That would restrict the author box to appear only on author archives. Now, if you want it to appear only once, at the top of the page, you'll need to modify the function a bit, as that's outside The Loop. You can try some code I have on this Gist: https://gist.github.com/4519891

    Does this help?

    Cheers!

    Pat


    Community • Work • Conversations

    January 12, 2013 at 1:48 pm #11484
    tommeyboy
    Member

    Thank you for the response.   I wanted the author box to show on single posts, archives, and everywhere else that the default wp press setup shows them.

     

    I was hoping to move the author box just above where the tags display on the single post and archive pages.

     

     

    January 13, 2013 at 3:47 pm #11664
    Gary Jones
    Member

    You've got an

    is_author

    in there instead of an

    is_author()

    and this may be coming up as true, so always showing the box via the second function.

     

    I also think that:

    if ( get_post_type() == “post” && is_single() && ! ( is_category() || is_tag() ) )

    could be simplified to:

    if ( is_singular( 'post' ) )


    WordPress Engineer, and key contributor the Genesis Framework | @GaryJ

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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