Jump to content
Sign in to follow this  
kinek

New Custom Post Type not working

Recommended Posts

kinek

A bit disappointed in the message I received after registering a new post type. I need this functionality working with this theme to better organize landing pages from normal pages. Once I enter content into the new post type and click "view" I receive the following message - "Direct Previewing of "Special Post Types" Not Available... Yet SORRY, DIRECT PREVIEWING OF SPECIAL "POST TYPES" SUCH AS "FEATURES" OR "BOXES" ISN'T UNAVAILABLE. THIS WORDPRESS FUNCTIONALITY IS NEW AND RAPIDLY DEVELOPING, SO IT SHOULD BE AVAILABLE SOON. TO PREVIEW A "CUSTOM POST TYPE" JUST VIEW A PAGE WITH THAT "SECTION" ON IT." Anyone have any ideas as to why this is showing? Is this a theme issue on how boxes were created? Thanks

Share this post


Link to post
Share on other sites
Rob

You seem to be viewing the post type rather than the page it's applied to. I think that's the reason.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kinek

I have custom post types applied on many sites and I simply give the post type a template file such as single-landingpage.php and I can view the post type perfectly. You can even set up an archive of the post types by turning on the archive in the post type meta. Why would I need to apply a post type to a page? Am I missing something?

Share this post


Link to post
Share on other sites
Rob

I get the same message when I try to view the page for each individual feature slider (also custom post types). Not sure why this is, so I'm going to bump this up to the developers for a solution.


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
kinek

For anyone reading this post, I have a solution for custom post types with the Platformbase theme. All I needed to do to get this to work was add 'has_archive' to my custom post type (not sure why, maybe a Pagelines developer can clear the air on this)....here is the code I used: /* add_action( 'init', 'cpt_test' ); function cpt_test() { register_post_type( 'test', array( 'labels' => array( 'name' => __('Tests'), 'singular_name' => __('Test') ), 'public' => true, 'menu_position' => 17, 'show_ui' => true, 'has_archive' => 'tests', 'supports' => array('title', 'editor','custom-fields', 'author'), 'rewrite' => array( 'with_front' => false ), ) ); } */ If you want the custom post type to have its own look and feel you will need to create a file single-{your-post-type}.php and place it in the PlatformBase theme folder. You can use the single.php code from the default Wordpress theme to get you started, and you can then switch up the class names and create your own custom look for your new post type.

Share this post


Link to post
Share on other sites
kinek
For some reason this only works for 1 custom post type. Anyone have any idea as to why this woulnd't work for 2,3 etc. I would love to get custom post types working the way they normally do with Wordpress with this theme.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×