Site logo

[Resolved] Author Boxes Displaying Weirdly

Home Forums Support [Resolved] Author Boxes Displaying Weirdly

Home Forums Support Author Boxes Displaying Weirdly

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2468900
    Jodie

    Hi,

    On my site, I’ve used a PHP snippet to display an author box only on one archive page, but it’s showing underneath every post in the page.

    How do I fix this please? Thanks for your help!

    Cheers Jodie

    #2468905
    Fernando
    Customer Support

    Hi Jodie,

    To clarify, are you referring to the Element called “Author Block”? If so, it’s set to display on All Posts through the display rules.

    #2468911
    Jodie

    Hi Fernando,

    Yes, I’ve set it to not display on “Author Archives” but it’s still displaying.

    Any ideas on how to fix this?

    Thanks!

    Cheers Jodie

    #2468915
    Fernando
    Customer Support

    I see. You have this custom code in your functions.php file:

    add_filter( 'generate_element_display', function( $display, $element_id ) {
        if ( 1526839 === $element_id && is_author( 'jodie-morgan' ) ) {
            $display = true;
        }
    
        return $display;
    }, 10, 2 );

    This code is the one setting the Element to display on that specific Author Archive page. You can remove that if you want it not to display there.

    #2468930
    Jodie

    Hi Fernando,

    Great, that fixed it, thank you so much for your help!

    Cheers Jodie

    #2468965
    Fernando
    Customer Support

    You’re welcome, Jodie!

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