WordPress.org

Ready to get started?Download WordPress

Forums

Yoast Breadcrumbs
[PATCH] Pass overrides to yoast_breadcrumb() (1 post)

  1. flynsarmy
    Member
    Posted 1 year ago #

    I have breadcrumbs showing in a couple of places and some need to be displayed a bit differently to others. The yoast_breadcrumb() function doesn't currently let you override on the fly so I wrote a little patch to allow it to.

    Replace

    function yoast_breadcrumb($prefix = '', $suffix = '', $display = true) {
    	global $wp_query, $post;
    
    	$opt = get_option("yoast_breadcrumbs");

    with

    function yoast_breadcrumb($prefix = '', $suffix = '', $display = true, $opt_overrides=array()) {
    	global $wp_query, $post;
    
    	$opt = array_merge(
    		get_option("yoast_breadcrumbs"),
    		$opt_overrides
    	);

    As an example of usage this lets me use:

    <ul>
    	<?php
    		yoast_breadcrumb('<li>','</li>', false, array(
    			'sep' => '</li><li>'
    		));
    	?>
    </ul>

    to show a standard HTML list.

    http://wordpress.org/extend/plugins/breadcrumbs/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.