Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Plugins & Atahualpa (http://forum.bytesforall.com/forumdisplay.php?f=16)
-   -   [SOLVED] Yoast Breadcrumbs And Page Menu Bar (http://forum.bytesforall.com/showthread.php?t=2034)

fromtheranks Jun 13, 2009 06:45 PM

[SOLVED] Yoast Breadcrumbs And Page Menu Bar
 
2 Attachment(s)
I'm trying to add bread crumbs to my page menu bar. I found http://forum.bytesforall.com/showthr...ght=breadcrumb and have been trying to emulate that logic with the Yoast Breadcrumb plugin: http://yoast.com/wordpress/breadcrumbs/.

I'm doing something wrong or haven't done something else that I should.

It works, sort of, but the Breadcrumbs do a new paragraph, or something at the end of the last page menu tab (in this case "Sitemap"), and it gets worse if I try to move through the pages ... it actually picks up the enter tab (format, borders and all) and inserts them into the bread crumb trail. See the attached images.

The default code from the yoast breadcrumb site is:

Code:

<?php if ( function_exists('yoast_breadcrumb') ) {
        yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>

In the tests below I tried the function with and without the argument as in the above example, and getting rid of the para tags helped, fractionally but that is all. (I also tried it in header.php and it didn't show up.)

I've tried two different styles of code in bfa_header_config (using the above forum link as a "template", and they both result in essentially the same result:

#1 - my code is in red:
Code:

        $page_menu_bar .= bfa_hor_pages($bfa_ata['sorting_page_menu_bar'], $bfa_ata['levels_page_menu_bar'],
        $bfa_ata['titles_page_menu_bar'], $bfa_ata['exclude_page_menu_bar']);
        if ( function_exists('yoast_breadcrumb'))
        {
                ob_start(); yoast_breadcrumb(); $yoast_breadcrumb = ob_get_contents(); ob_end_clean();
        }
        $page_menu_bar .= $yoast_breadcrumb;

        $page_menu_bar .= '</ul></div>' . "\n";
        // END of Page Menu Bar

#2 - I also tried this version:
Code:

        if ( function_exists('yoast_breadcrumb'))
        $page_menu_bar .= '<li class="breadcrumbs">You are here $raquo;';
        {
                ob_start(); yoast_breadcrumb(); $yoast_breadcrumb = ob_get_contents(); ob_end_clean();
        }
        $page_menu_bar .= $yoast_breadcrumb;
        $page_menu_bar .= '</li></ul></div>' . "\n";

Am I coding something incorrectly. Possible, considering I'm new to PHP and HTML. Or. Am I barking up a dead tree here? ...

Thanks in advance. :confused:

fromtheranks Jun 14, 2009 06:28 PM

Hi.

Has anyone successfully added a Breadcrumb plugin to their Page Menu Bar? See my two attempts below.

The reason I'd like to use the page menu bar is that it isn't terribly full and I'd like to not add another row of stuff to the header area.

Thanks in advance.

juggledad Jun 14, 2009 07:26 PM

I just played with this for a while and came up with the same results as you did. the problem is that Yoast Breadcrumb is creating text mixed with several <a...> and they are in an unordered list. While you could use the Yoast prefix and suffix to make this a list, the styling that's already applied to the list is causing what you see.

If you wanted this on a seperate line from the menu, it is easy, just put the code at the end like this
HTML Code:

        $page_menu_bar .= '</ul></div>' . "\n";

        if ( function_exists('yoast_breadcrumb') )
                {
                $page_menu_bar .=  yoast_breadcrumb("", "\n", false);
                }
        // END of Page Menu Bar


fromtheranks Jun 14, 2009 07:53 PM

A thousand thanks, Juggledad.

It's nice to know it wasn't something silly I did. ... Maybe I'm beginning to learn a little something, from studying yours and Flynn's code, after all. :)

Just wondering, have you ever worked with Breadcrumb NavXT? And tried anything like this?
http://mtekk.weblogs.us/code/breadcrumb-navxt/
After uninstalling Yoast, that's my next attempt (unless you have a better suggestion).

Thanks.

A small token is on its way. :)

fromtheranks Jun 14, 2009 07:55 PM

Hmmmm ... the "Click here" link to donate doesn't seem to be linking. Do you have to catch that when you first open your reply? Before responding?

Thanks.

fromtheranks Jun 14, 2009 07:56 PM

Never mind. Stupid question. I really have to get some sleep one of these days.

fromtheranks Jun 14, 2009 07:59 PM

On its way.

Thanks again, Jugglehead.


All times are GMT -6. The time now is 01:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.