• Resolved tom1899

    (@tom1899)


    Hi,

    I am trying to insert a page into my breadcrumb path – and the destination is a custom post type.

    I understand that WordPress does not play nice with paths of mixed types.

    I got Yoast Premium and was pointed to an example using wpsep_breadcrumb_links

    
     *********
     * DIFFERENT POST TYPES
    
     * Page: Change is_single to is_page and 123456 to the page ID
    
     *********
    
    add_filter( 'wpseo_breadcrumb_links', 'wpseo_breadcrumb_remove_limited' );
    
    function wpseo_breadcrumb_remove_limited( $breadcrumbs ) {
        if ( is_page ( page ID ) ) {
    		return array(
    			'url' => '',
    			'text' => ''
    		);
        }
    	else {
    		return $breadcrumbs;
    	}
    }

    My questions are:

    Do I need to fill in the area ‘url’ and ‘text’ – and it does the rest?

    Or do I need to just add this code to the functions.php with my page id – and then fill something out in the Yoast area of said page?

    Close (I think) – but don’t want to do something careless and mess up the site (its a dev site so no URL to view.

    Thank you for any help!

Viewing 1 replies (of 1 total)
  • Plugin Support Jose Varghese

    (@josevarghese)

    Hi @tom1899

    Thanks for using Yoast SEO plugin.

    Yes, you need to add the title and URL to the code if you prefer to add it to the breadcrumb path. You can find out some sample codes here for reference.

    We recommend creating regular backups of your site and database for your site’s health and safety. A backup is crucial before editing files on your website?and provides you with a safety net if something were to go wrong. Learn more about the benefits of regular backups.

Viewing 1 replies (of 1 total)
  • The topic ‘Breadcrumb Help: Page to Custom Post Type’ is closed to new replies.