Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress Custom Post Type Menu

Featured Replies

Ok, scratching my head at this one!

 

I have a custom post type called 'portfolio'. Now I have an area on certain pages where I need to output a list of all the posts within this post type. So, as far as I can tell,I have two options;

 

  • a custom menu
  • or, query posts

 

Simple enough, I can get both options to work nicely. Now the interesting part. I need all new posts within this post type automatically added to the list/menu (simple enough uysing query posts, but not able to do so using a custom menu) AND the current portfolio item needs to be highlighted in a different colour/displayed slightly different (easy to do in a custom menu using 'current-menu-item', but not happening using query posts).

 

So! You see my issue, I need a solution that can handle both the above requests.

 

Fire away WordPress hardcore devs!!

 

:help:

  • Author

Have you got "show_in_nav_menus" declared in your register_post_type() args for the custom post type?

 

If not, add it and it should make the post types appear in your custom menu.

 

Yeah, the post types appear in the menu, the menu just won't populate any new posts for the post type, without the client having to manually add them!

 

No worries though, found this http://css-tricks.com/snippets/wordpress/list-posts-highlight-current/ which has solved the issue and works now.

 

Gotta love Chris Coyier :)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.