0

I'm using a Genesis child theme with the 'Genesis Co-Authors Plus' which enables support for Co-Authors Plus

I'd like to disable the author box everywhere except for the blog.

Genesis Co-Authors Plus removes the default Genesis genesis_do_author_box_single and replaces it with gcap_author_box

So far I've got a conditional function to remove gcap_author_box from the custom post type local-bite

I tested the conditional statement with a simple echo and it is working fine. So what is wrong with the following?:

// Remove 'Genesis Co-Authors Plus' from custom post type
add_action('init', 'lf_remove_author_box');
function lf_remove_author_box() {
    if ( is_singular( 'local-bite' ) ): {
        remove_action( 'genesis_after_entry', 'gcap_author_box', 8 );
    }
    endif;
}

There is a very similar post here which is helpful.

but I don't understand what I need to put in immediately after add_action - I've copied what is in the Genesis Co-Authors Plus which is init. I've also tried wp, can anyone help?

  • You should ask this question on the genesis support forum as support for third party themes are off topic here. Thank you – Pieter Goosen Sep 22 '14 at 5:14
  • ok no worries, sorry, I just saw there is a genesis theme tag so I assumed it would be fine, feel free to delete my post if need be – morktron Sep 22 '14 at 6:47
0

I got it working in the end by using 'template_redirect' and changing the remove_action number from 8 to 1 :)

// Remove 'Genesis Co-Authors Plus' author box and 'filed under' from custom post type
add_action('template_redirect', 'lf_custom_cpt_display');
function lf_custom_cpt_display() {
    if ( is_singular( 'local-bite' ) ): {
        remove_action( 'genesis_after_entry', 'gcap_author_box', 1 );
        remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
        remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
        remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
    }
    endif;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.