• Resolved powerj9

    (@powerj9)


    Can someone tell me the equivalent of this filter using AIOSEO please

    add_filter('wpseo_breadcrumb_links', function( $links ) {
        global $post;
        if ( is_single ( 123456 ) ) {
            $breadcrumb[] = array(
                'url' => site_url( '/blog/' ),
                'text' => 'Blog',
            );
            array_splice( $links, 1, -2, $breadcrumb );
        }
        return $links;
    }
    );

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @powerj9, here you go:

    add_filter( 'aioseo_breadcrumbs_trail', function ( $crumbs ) {
    	if ( is_single( 123456 ) ) {
    		$blogCrumb[] = [
    			'label' => 'Blog',
    			'link'  => site_url( '/blog/' ),
    		];
    		array_splice( $crumbs, 1, - 2, $blogCrumb );
    	}
    
    	return $crumbs;
    } );

    Let us know how that goes and if you need further assistance!

    Thread Starter powerj9

    (@powerj9)

    Thank you so much – worked great!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Breadcrumb filters’ is closed to new replies.