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

    Is it possible to show breadcrumbs on category displays only?

    #945604

    Hey wacky32,

    You can use css to hide them on all other pages or the individual blog page, if I’m understanding you correctly.

    Best regards,
    Jordan Shannon

    #945628

    Hi Jordan,

    I’d like to hide them everywhere, except for top level category pages.

    I know I can manually turn them off/on in each individual page/post, but I’m trying to make this change after a few hundred pieces of content have already been created. Hoping there’s an existing solution for css code fix.

    Thanks!

    #946521

    Hi,

    Thank you for the update. Use this filter to enable the breadcrumb on category or archive pages only.

    // enable breadcrumb on archive pages only
    add_filter( 'avia_breadcrumbs_trail', 'avia_breadcrumbs_trail_mod', 20, 2 );
    function avia_breadcrumbs_trail_mod( $trail, $args ) {
        if( !is_archive() ) {
           unset($trail); 
    	}
    
    	return $trail;
    }

    Best regards,
    Ismael

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