• Resolved Marklcm

    (@marklcm)


    The breadcrumbs output Home -> Category: Blah -> Post Name

    on a blog post
    Is it possible to have the output as

    Home -> Category: Blah -> Blog -> post name

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    TSF’s breadcrumbs will always reflect the default WordPress structures.

    Still, you can add “blog” to it if you’d like — though it wouldn’t be of much use to search engines. You can achieve this using a filter — you must still adjust the blog URL in it:

    add_filter(
    	'the_seo_framework_breadcrumb_list',
    	function( $list, $args ) {
    
    		if ( null === $args && is_singular() ) {
    			$blog = [
    				'url'  => 'https://example.com/blog/', // This is best fetched via the WP Query API.
    				'name' => 'Blog',
    			];
    
    			// Insert a "Blog" entry as the second-to-last element.
    			array_splice( $list, -1, 0, [ $blog ] );
    
    			return $list;
    		}
    
    		return $list;
    	},
    	10,
    	2,
    );

    Note that this will also affect the Schema.org structured data describing the breadcrumbs for search engines.

    Please consider adhering to the default WordPress structure for a more comprehensible internal linking structure.

    Thread Starter Marklcm

    (@marklcm)

    I will follow your advice, and adhere to the default WordPress structure, thanks.
    After implementing your breadcrumbs, I asked a small number of users to comment.
    Some commented (without any prompt) that the “Blog” link in the crumbs was missing. That is why I asked the question.
    My Woo Store does not use the archive page, rather a true page as the front of shop.
    The crumbs for it are
    Home > Shop > Category: Some Cat > single product.
    Would you for see problems doing the same for the Blog, using a Page with a query loop to pull in the posts, rather than using the archive?

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi again!

    Sorry, I thought the issue was resolved; I inadvertently skipped over your last sentence.

    I’m not sure I understand your question. Could you give me an example of what you have now and what you want instead?

    Still, as long as the trail is logical for your site’s flow and your users, it should be fine for search engines.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Breadcrumbs’ is closed to new replies.