How can I display older custom post outside the loop in Wordpress?

Can I create custom admin boxes in Wordpress that dynamically show/hide based on the post/page template selected by the user?

  • For instance, say inside the 'Post' admin I have an 'Events' template that they can select that will style that post differently on the site. However, that post template will also require extra meta data from custom fields. I'm not a big fan of making users deal with the custom fields box, so I generally create a box in the admin panel that asks them only for the meta I need. If they're not using the 'Events' template, I don't need this box to show. Is there any way to only display a custom admin box when they select a specific template? Is this at all possible in Wordpress? If so, how do I do it?

  • Answer:

    I think what you're looking for is 'Custom Post Types'. https://codex.wordpress.org/Post_Types#Custom_Types You can set up the custom post type and add custom meta boxes to each post type. https://codex.wordpress.org/Function_Reference/add_meta_box Alex King has a plugin on his site for changing the UI depending on certain Post Formats, but there's a limited list of possible post formats that you can use with WordPress - http://alexking.org/blog/2011/10/25/wordpress-post-formats-admin-ui

Josh Betz at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.