Output before

#211361
  • Resolved wooexperten
    Rank Math free

    Hi there!

    In my template, I use “rank_math_the_breadcrumbs()” to output breadcrumbs.

    How do I output something right before the closing /nav tag in the breadcrumb? Such as a custom link or similar.

    Cheers

Viewing 3 replies - 1 through 3 (of 3 total)
  • Ankit
    Rank Math business

    Hello,

    Thank you for contacting the support and sorry for any inconvenience that might have been caused due to that.

    You can use the following filter to modify the values of the breadcrumbs:

    /**
     * Filter to change breadcrumb args.
     *
     * @param  array $args Breadcrumb args.
     * @return array $args.
     */
    add_filter( 'rank_math/frontend/breadcrumb/args', function( $args ) {
    	$args = array(
    		'delimiter'   => ' / ',
    		'wrap_before' => '<nav class="rank-math-breadcrumb"><p>',
    		'wrap_after'  => '</p></nav>',
    		'before'      => '',
    		'after'       => '',
    	);
    	return $args;
    });

    You can follow the link for more breadcrumbs filters/hooks:
    https://rankmath.com/kb/filters-hooks-api-developer/#breadcrumbs

    Hope that helps and please do not hesitate to let us know if you need our assistance with anything else.

    Perfect!

    Hello,

    Glad that helped.

    Please feel free to reach out to us again in case you need any other assistance.

    We are here to help.

    Thank you.

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

You must be logged in to reply to this ticket.