• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Setup menu incl. dummy pages and CPT Archives – Breadcrumbs

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Setup menu incl. dummy pages and CPT Archives – Breadcrumbs

This topic is: not resolved

Tagged: breadcrumbs, menu, navigation

  • This topic has 3 replies, 2 voices, and was last updated 6 years, 2 months ago by Victor Font.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • July 7, 2017 at 4:23 pm #208837
    mmjaeger
    Member

    hello
    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 #208843
    Victor Font
    Moderator

    Select 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 #208845
    mmjaeger
    Member

    thanks 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 #208871
    Victor Font
    Moderator

    The 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?

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble