• Resolved mobeigi

    (@mobeigi)


    Howdy,

    Is there any way to customise the bread crump generation right now? Or this this planned for the future?

    My use case is I run my WordPress blog at a subfolder /blog.
    I also don’t want prefixes in-front of the categories and don’t want the final item included in the breadcrump.

    For example, for the URL:
    https://example.com/blog/programming/java/how-to-do-something

    I’d like the breadcrumb to be:
    Blog ? Programming ? Java

    Let me know if it is possible.

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

    (@cybr)

    Howdy!

    There are plans to further customize the breadcrumb output. I just added your requests to the ever-growing list.

    But for now, it’s not possible to remove the “Category:” prefix without also affecting the titles on the category pages. You must either edit the category meta title or remove all prefixes via “SEO Settings > Title Settings > Prefixes.”

    To remove the current page, you can use either CSS or a PHP filter.

    Here’s the CSS:

    .tsf-breadcrumb .breadcrumb-item:last-child {
        display: none;
    }
    
    .tsf-breadcrumb .breadcrumb-item:nth-last-child(2):after {
        display: none;
    }

    You may be able to install that via the WordPress admin, but this process can differ per theme.

    Alternatively, here’s the filter:

    add_filter(
    	'the_seo_framework_breadcrumb_shortcode_css',
    	function ( $css, $class ) {
    
    		$css["nav.$class li:last-child"][] = 'display:none';
    		$css["nav.$class li:nth-last-child(2):after"][] = 'display:none';
    
    		return $css;
    	},
    	10,
    	2,
    );

    (Where do I place filters?)

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.