[Support request] After Content GP Hook – Display:none on Taxonomies?

Home Forums Support [Support request] After Content GP Hook – Display:none on Taxonomies?

Home Forums Support After Content GP Hook – Display:none on Taxonomies?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #937807
    Brian

    Using the GP hook for After Content puts items in the taxonomies as well. I’m sure this is a simple php if statement, but for whatever reason I’m having a massive brain fart.

    How would I get the hook not to fire (or display:none) on the taxonomies, or anywhere else besides the posts/pages.

    Thanks,
    Brian

    #937927
    Brian

    Might also help to know that the hook is executing php and currently contains:

    <?php the_field('benefits'); ?>
    <?php if(  get_field('desire') == '90%' ): ?>
    <?php echo do_shortcode("[PROGRESSBAR_WP id=3897]"); ?>
    <?php endif; ?>
    <?php if ( function_exists( 'wpsabox_author_box' ) ) echo wpsabox_author_box(); ?>
    <?php related_posts(); ?>
    #937950
    Brian

    I *think* I have a possible solution, but I’ll leave this open in case you know of a better global way to nest these statements. I know just enough PHP is completely break a site. ๐Ÿ˜‰

    Possible solution:

    <?php if ( is_single() ) {the_field('benefits');} ?>
    <?php if ( is_single() ) {if(  get_field('desire') == '90%' ): ?>
    <?php echo do_shortcode("[PROGRESSBAR_WP id=3897]"); ?>
    <?php endif;} ?>
    <?php if ( is_single() ) {if ( function_exists( 'wpsabox_author_box' ) ) echo wpsabox_author_box();} ?>
    <?php if ( is_single() ) {related_posts();} ?>
    
    // To use on single post add "if (is_single() {functionality;}
    #938052
    Leo
    Staff
    Customer Support

    Hi there,

    Maybe I’m missing something here but have you tried the Display Rules?
    https://docs.generatepress.com/article/hooks-element-overview/#display-rules

    You can just set it to Post > All Posts and Page > All Pages.

    Let me know ๐Ÿ™‚

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.