Home › Forums › Bee WordPress Theme › breadcrumbs links
- This topic has 4 replies, 2 voices, and was last updated 12 years, 2 months ago by
Johnny.
-
AuthorPosts
-
April 15, 2014 at 6:48 pm #3037
agenciz
Participanthello,
the breadecrumbs link to category,
i want that it links to page or single post,
is it possible ?
and how change it ?
bestApril 16, 2014 at 9:19 am #3047Johnny
ParticipantHi, please give me more details about this, which link to which page?
Thank youApril 16, 2014 at 12:27 pm #3050agenciz
Participanti want to change the hierarchy of the breadcrumbs.
Now when i click on the word in the breadcrumb, this is the category page which is display
i want that will be the parent post or parent page, like in your bredacrumbs on this web site.best.
April 16, 2014 at 2:56 pm #3052agenciz
Participantre,
in the breadcrumbs file in section POST, you have this :
$taxonomies = get_post_taxonomies($post->ID);
if (count($taxonomies) > 0) {
foreach($taxonomies as $taxonomy) {
if(is_taxonomy_hierarchical($taxonomy)) {
foreach (wp_get_object_terms($post->ID, $taxonomy) as $term) {
if($term->taxonomy == ‘category’) {
foreach(explode(‘|’, get_category_parents($term->term_id, false, ‘|’, true)) as $ancestor) {
if(trim($ancestor) && $ancestor != $term->slug) {
$ancestor = get_category_by_slug($ancestor);
$this->setBreadcrumb(‘slug, $taxonomy) . ‘” title=”‘ . $ancestor->name . ‘”>’ . $ancestor->name . ‘ ‘);
}
}
}
$this->setBreadcrumb(‘slug, $taxonomy) . ‘” title=”‘ . $term->name . ‘”>’ . $term->name . ‘ ‘);
}
$this->setBreadcrumb($this->_elements[‘separator’]);
}
}
}So, i don’t want the category displaying but the post or the page ancestor.
i hope that i m understable.
Best
April 17, 2014 at 6:49 am #3061Johnny
ParticipantHi,
-For the page, if you set parent page, you can display the parent page
-For the post, because the post can not be set parent page, we can only display its category
Best -
AuthorPosts
- You must be logged in to reply to this topic.
