Community Forums › Forums › Archived Forums › Design Tips and Tricks › Setup menu incl. dummy pages and CPT Archives – Breadcrumbs
Tagged: breadcrumbs, menu, navigation
- This topic has 3 replies, 2 voices, and was last updated 8 years, 6 months ago by
Victor Font.
-
AuthorPosts
-
July 7, 2017 at 4:23 pm #208837
mmjaeger
Memberhello
I need some advise in regards to the navigation menu.Let's say for instance on the menu I'd like to have a menu item "Company" - when clicking on "Company" I'd actually like to go to a page called "About Us" which is a sub-menu item of "Company" - on the breadcrumbs I still like to see Home -> Company -> About Us
Similar scenario in regards to CPT Archives - I've a CPT Archive as a sub-item of "Company" - the breadcrumbs however only shows Home -> Archives for CPT Name instead of Home -> Company -> CPT Name.
Last but not least I was wondering whether the CPT Name that's shown in the breadcrumbs could be customized.Hope somebody can provide some insight - thank you in advance for your input.
July 8, 2017 at 7:37 am #208843Victor Font
ModeratorSelect Company as the parent page: http://www.wpbeginner.com/wp-tutorials/how-to-display-a-list-of-child-pages-for-a-parent-page-in-wordpress/
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?July 8, 2017 at 7:43 am #208845mmjaeger
Memberthanks Victor - I'm afraid my question wasn't clear - I'm just talking about Navigation and Breadcrumbs - there is basically no parent "Company" - it is just a menu item using "custom-link"
July 9, 2017 at 3:38 am #208871Victor Font
ModeratorThe menu setup is easy. When you add the About page to the menu, just change the text to say Company.
The bread crumb setup isn't as easy and requires custom code. The custom code will also require some maintenance when add or remove items from the Company menu. This code will append a dummy Company item, linked to an about page, right after the Home breadcrumb
add_filter( 'genesis_home_crumb', 'add_company_to_breadcrumbs' ); function add_company_to_breadcrumbs( $crumb ) { $pages = array(1, 2, 3, 4, 5,); if ( is_page( $pages ) ) { $crumb .= ' / <span class="breadcrumb-link-wrap" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem"><a href="http://localhost/public_html/about/" itemprop="item"><span itemprop="name">Company</span></a></span>'; } return $crumb; }There are two things that require maintenance from you. First is the pages array. You have to change the 1,2,3,4,5, to the page ids for the pages you add to the company menu. If you don't know how to find the page id, install the reveal ids plugin. Second, change the link href to point to your about page.
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet? -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.