Hi ThemeForest and CodeCanyon people (and WP gurus on the other marketplaces!)
Has anybody successfully nested a Custom Post Type under a standard WordPress page?
I have tried every recommendation on wordpress.stackexchange.com with no success.
I am trying to get all my custom
wiki post types to display under the wordpress page
Setting the "slug" on the wiki post type to
support/documentation-wiki works in the URL, eg:
but what I'm struggling with is the "current" menu item highlighting. When viewing a wiki page the "Documentation/Wiki" menu and the "Support" menu at the top should be highlighted. I want to avoid hardcoding page id's (like I've done on the forum) as this causes issues when the same theme is used on multisite.
It would also be nice not to have to hardcode the wiki 'slug' in the code, just select a page parent.
Setting the wiki post_parent to the page ID in the database does not work and the custom wiki post type is hierarchical. I've even tried things like hardcoding the post_parent on page load (this is what wp menu checks when doing its highlighting) but that didn't work either.
// run in the 'wp' hook when loading a wiki article.
$wp_query->queried_object->post_parent = 611;
$wp_query->post = $wp_query->queried_object;
any ideas? any success?