Tagged: Blog, breadcrumb, enfold, parent
-
AuthorPosts
-
February 1, 2014 at 11:09 pm #218296
1. I’m using categories in my pages type
2. Using blog grid element to display the grouping of these pages which are all in root (existing custom php site url structure)Would like to assign breadcrumb to get back to parent page.
Structure like this:
fruits.com/citrus is the blog grid displaying the top-level (no parent) pages example /oranges /lemons
On the individual pages like /oranges the breadcrumb is
Home > OrangesI would like to insert the Citrus page which I could set as a custom meta field in the page then retrieve into breadcrumb to get
Home > Citrus > OrangesBy making citrus parent of oranges this would work but it also changes the url so thats not an option
Any ideas how to make this work?
wp-content/themes/enfold/includes/helper-template-logic.phpFebruary 3, 2014 at 5:49 am #218616Hello!
It is possible but that customization is beyond the scope of the support we can offer.
Alternatively, you can assign the parent and to fix the Permalinks ‘issue’ use this: http://wordpress.org/plugins/custom-permalinks/
Cheers!
JosueFebruary 3, 2014 at 9:21 am #218674Hi!
You can try the code I posted here: https://kriesi.at/support/topic/breadcrumb-and-blog-title-formatting/#post-214336 – replace the id “20” with the id of your “Citrus” blog page.
Best regards,
PeterFebruary 3, 2014 at 9:53 pm #218998Thank you Peter that function helped fix the missing blog breadcrumb when using the blog grid without ‘assigning’ a blog page.
I modified it for use with ‘page’ post type. Now I can assign a ‘parent’ page breadcrumb to otherwise orphan pages.
Thank you again Peter and team Kriesi your support is outstanding! and much appreciated!Here’s the code for for others wanting to set a page parent breadcrumb – put the desired parent page id in custom field named ‘parent_breadcrumb-postid’
if(!function_exists('avia_modify_page_breadcrumb')) { function avia_modify_page_breadcrumb($trail) { if(get_post_type() === "page" ) { $pageid = get_field('parent_breadcrumb_postid'); if($pageid) { $page = '<a href="' . get_permalink( $pageid ) . '" title="' . esc_attr( get_the_title( $pageid ) ) . '">' . get_the_title( $pageid ) . '</a>'; array_splice($trail, 1, 0, array($page)); } } return $trail; } add_filter('avia_breadcrumbs_trail','avia_modify_page_breadcrumb'); }
Let me know if you see any improvements.
Cheers -
AuthorPosts
- The topic ‘Add breadcrumb from 'parent' blog grid page’ is closed to new replies.