Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Breadcrumbs demo #135

Closed
manwithacat opened this issue Oct 22, 2014 · 11 comments
Closed

Breadcrumbs demo #135

manwithacat opened this issue Oct 22, 2014 · 11 comments

Comments

@manwithacat
Copy link
Contributor

Something I add to FoundationPress - usually at the end of header.php - is a quick bit of code for breadcrumbs (internal links):

<div class="row">
<?php if ( function_exists('yoast_breadcrumb') && !is_front_page() ) {
              yoast_breadcrumb('<p id="breadcrumbs" class="breadcrumbs">','</p>');
        } ?>
</div>

This adds a grid row, and prints the breadcrumbs applying the relevant classes [the div can also be within the if statement, just an example here to show which bit does what].

On the one hand, this is a plugin dependency [albeit with a check], but on the other hand it's a great way to use/demo the Foundation breadcrumbs classes in a Wordpress site.

I can make a pull request if you think it's worth including in the core theme.

@dantahoua
Copy link
Contributor

Funny, I did exactly the same for the website that require a breadcrumb (some design don't, but usually I just hide it, so google is able to take it for SEO)...

@Aetles
Copy link
Contributor

Aetles commented Oct 23, 2014

Nitpicking: shouldn't the div also be inside the conditional so it does not print empty if the plugin is not present?

@olefredrik
Copy link
Owner

I have tried to keep the theme independent of third-party plugins. Would also like to keep it that way. But what if we include those parts of the plugin that deals with breadcrumbs directly in the theme (via functions.php)? Is it a good or bad idea?

@linuxbastard
Copy link
Contributor

I've used a couple of breadcrumb code (from foundation 5) in other wp sites that aren't dependent on any plugins. I'll see if I can add it here.

http://paglalakbay.biz/custom-breadcrumbs-function/

This was prior to 5.4.7 but should still work with a few adjustments.

@themestechnology
Copy link
Contributor

I have some code that does the SEO that Yoast's plugin does and also works with FoundationPress, how can I send it?

@olefredrik
Copy link
Owner

@themestechnology : Please create a new pull request: https://help.github.com/articles/using-pull-requests/

@vimes1984
Copy link

Did this ever get committed?

@themestechnology
Copy link
Contributor

Im on the move at the moment so I have not yet tested the code but this is basically what you need, I will do a commit in a few hours... https://github.com/themestechnology/FoundationPress-comments/blob/master/parts/breadcrumb-mettadata.php

simply use get_template_part('parts/breadcrumb-mettadata'); in your footer

@vimes1984
Copy link

I prefer to add the function into a custom-functions.php file in library
then add a page part called breadcrumbs..
as a side not this code doesn't quite work it shows home/ / page name and given the amount of ifelses shouldn't it be a switch?

@themestechnology
Copy link
Contributor

https://github.com/themestechnology/FoundationPress-comments/blob/master/library/foundation.php

Just use a do_action('FoundationPress_do_bredcrum'); to place it where you want

@themestechnology
Copy link
Contributor

There is now a pull request for that @olefredrik however I will leave it up to you do remove another breadcrumbs in the theme

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants