Skip Navigation

[Fermé] Confusion about hierarchy, Views, and breadcrumbs

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 2 réponses, has 2 voix.

Last updated by Amir Il y a 9 années et 4 mois.


I have a custom post type named "Packages", which was working nicely until the client requested that the Packages archive be nested beneath a parent page. They also asked that I change the name of the page and link from Packages to Special Packages.

Initially I was using archive-packages.php to display the archive, but decided to create a View instead.

The View for the Special Packages page looks like so:
hidden link

It works great, but when you visit one of the package posts the breadcrumbs don't display how I'd like them to.

I get:

Home / Packages / The Package

but would rather have:

Home / Stay / Special Packages / The Package

I don't doubt that's the correct WP behavior, but I'm wondering if there's a way (perhaps I missed something in the CPT setup) to get the URL and breadcrumbs to include the "Stay" parent name and "Special Packages" page name, like so:

Home / Stay / Special Packages / The Package
and hidden link



Here's the current setup for that post type:

name plural: Packages
name singular: Package
slug: packages

x Package Types

Add New > Add New Package
Add New Item > Add new %s
Edit Item > Edit %s
New Item > New %s
View Item > View %s
Search Items > Search %s
Not Found > No %s found
Not Found In Trash > No %s found in Trash
Parent Item Colon > Parent %s
All Items > %s

x Title
x Editor
[ ] Comments
[ ] Revisions
[ ] Author
x Excerpt
x Thumbnail
x custom-fields
x page-attributes
[ ] post formats

x Rewrite
* Use the normal WordPress URL logic
x Allow permalinks to be prepended with front base
x Feeds
x Pages
[ ] has_archive *
x show_in_menu
Optional field is empty
x show_ui
x publicly_queryable
[ ] excluded_from_search
x hierarchical
x can_export
x show_in_nav_menus
x query_var
Optional field is empty
Permalink epmask

* I deselected the has_archive option this morning since I'm using a View on the "Special Packages" page to display the list. That removed the archive page from the breadcrumb, which I want. Now I'd just like to see / Stay / Special Packages added to the breadcrumb, and /stay/special-packages added to the URL.

I'm not using a plugin for the breadcrumbs. The parent theme is called Prototype.




The thing is, today a View can display in a separate page but not take over standard 'archive' pages (or taxonomy, or index, or search, etc.).

The alternative is to use a Content Template to output each of the results in your standard Archive page. This is 50% solution, as it will only let you customize the internals of each result, but not the page structure itself. To control this, create a new Content Template and assign it to the archive page in Views->Settings.

We'll have the feature that you're requesting in Views 1.1. This will be like 'half Views', where the query comes from WordPress, but the View implements the layout. I don't have an exact date for that yet. We're hoping to have it around the end of May.

Le sujet ‘[Fermé] Confusion about hierarchy, Views, and breadcrumbs’ est fermé à de nouvelles réponses.