• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Exclude or Include Genesis Author Box On Specific Single Pages

By default, the author box in Genesis doesn’t display on single pages. However, you can add the following PHP code to your child themes functions file to add include & exclude certain single pages.

add_action( 'genesis_entry_footer', 'conditional_author_box' );

function conditional_author_box() {

if ( is_page(array( '128', '130' ) ) ) :

genesis_author_box( 'single' );
    
endif;
}

The above code includes the is_page() conditional tag with the page i.d’s for 2 pages, 128 & 130 which are included and all other single pages are excluded.

You could also write the code like this :

add_action( 'genesis_entry_footer', 'conditional_author_box' );

function conditional_author_box() {

if ( is_page(array( '128', '130' ) ) ) {

genesis_author_box( 'single' );
    
    }
}

You can also write the code like this using the is_single() conditional tag :

add_action( 'genesis_entry_footer', 'conditional_author_box' );

function conditional_author_box() {

if ( is_single(array( '128', '130' ) ) ) :

genesis_author_box( 'single' );
    
endif;
}

Assumes you have ticked the author box checkbox on the Users > Your Profile > Author Box > Enable Author Box on this User’s Posts?

Related Code Snippets

  • Display Genesis Author Box Using Checkbox
  • Remove Genesis Author Box From Single Post
  • Add or Remove Author Box Only When Custom Field Has Value

Author Box

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems