• Resolved sblooom

    (@sblooom)


    `Hi,

    I thought someone might have encountered this problem before, but I can’t find the answers: I have a menu with parent categories that are not actual pages. These are just group categories (for menu) of my current pages and subpages (no posts). But I would like these categories to appear in the URL and BBREADCRUMB. For exemple :

    CATEGORY 1
    Page 1
    page 1a
    page 1b
    page 2
    page 2a
    CATEGORY 2

    I thought one possibility might be to create categories for PAGES (with a plugin) and add them to permalinks as /% category% /% postname% /. But the categories do not show in the URL of the pages, only for the articles.

    I wouldn’t prefer to create a blank parent page, which doesn’t look really clean to me (for SEO…).

    An idea ?
    thanks for the help

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author John Havlik

    (@mtekk)

    Typically, if you want to add a category to a page, you really should be using a custom post type. If you use a hierarchical custom post type, you can have Breadcrumb NavXT use post parents as the first hierarchy and then a taxonomy as a secondary hierarchy (fulfilling what you want out of the breadcrumb trail). As for making the permalinks the way you want, my guess is it’s probably possible (especially is you use a custom post type and custom taxonomy). That said, it has been quite a while since I’ve dived deeply into permalinks and custom rewrite rules so I don’t have an example off hand to point you to.

    Thread Starter sblooom

    (@sblooom)

    Thanks for help!

    Just for information, I could use custom post but it would not make sense since they just are regular pages. I finally created blank pages for level 1, and made my hierarchy in pages. Then I disabled all links from level 1 for breadcrumb (and menu) with this code :

    add_filter('bcn_breadcrumb_url', 'my_breadcrumb_url_stripper', 3, 10);
    function my_breadcrumb_url_stripper($url, $type, $id)
    {
        if(in_array('post-page', $type) && in_array((int) $id, array(121)))
        {
            $url = NULL;
        }
        return $url;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Parent as url/breadcrumb but not page’ is closed to new replies.