• 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

Help me correct the code If is_single

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 › Help me correct the code If is_single

This topic is: resolved
  • This topic has 3 replies, 2 voices, and was last updated 5 years, 11 months ago by wparrow.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 12, 2017 at 11:12 am #204686
    wparrow
    Member

    Hello,

    I tried to use Simple Hooks to insert the Author Box to the end of single post. However, the Author Box always display in the Category archive.

    I need the code to let it display in Single post only.

    The code to display Author box is:
    <?php if ( function_exists( 'wpsabox_author_box' ) ) echo wpsabox_author_box(); ?>

    and I have put it into genesis_entry_footer

    Could you please help me write the condition code just like:
    If is_single()
    display author box
    else return(displaynothing)

    Thanks very much!

    April 12, 2017 at 8:48 pm #204700
    carasmo
    Participant

    Genesis has two check boxes on the user page whether or not to show the author box on single posts and/or archives. wpsabox_author_box is not part of Genesis.


    Genesis Theme Customization and Help

    April 12, 2017 at 10:17 pm #204703
    wparrow
    Member

    Thanks Carasmo for your reply.
    I known there is default Genesis author box. However, I do not want use it, I want use the author box from third party with more feature.

    What I want is the conditional code to run the PHP code above at single post only.

    Is it possible ? Or it's hard to do?

    April 13, 2017 at 8:16 am #204730
    wparrow
    Member
    <?php if( is_singular( 'post' ) ) {
    if ( function_exists( 'wpsabox_author_box' ) ) echo wpsabox_author_box();
    }
    ?>

    The code above works, it's very simple and not sure why nobody help

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Help me correct the code If is_single’ is closed to new replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

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