Jump to content
Sign in to follow this  
michdawson

Fixing Custom Post Type Page - EcoPro

Recommended Posts

michdawson

Using the EcoPro theme, I created a custom post type "tips" and a template called "Page of Tips". I then put the following code in my _template.php file to display the tips:

<?php if(is_page_template('page-tips.php')): // is a Tips page ?>
	<?php query_posts('post_type=tips') ?>
	<?php endif;  ?>

This is what I get: http://sustainablelafayette.org/?page_id=1260 The "next page" and "previous page" options are broken (it reloads the page) and I'm not able to format that page given the implementation. Is there something I should be adding to my _loop.php page? Thanks in advance

Share this post


Link to post
Share on other sites
cmunns

You may have to add a conditional for the previous and next links for that post type. I'm curious why not use a category for "tips"?

Share this post


Link to post
Share on other sites
michdawson

Thanks Adam. I'm using categories for managing the categories or type of stories I'm posting. I didn't want "tips" mixed with those when I do tag clouds or show the thumbnail feature bar at top of those story pages, for example. I assumed custom post types was the best way to handle different types of content, or am I wrong? The heirarchy is like this: Stories (posts) : each category has its own page and I show one mixed page of most recent stories. - Residential - category - Business - category - Schools - category - etc Tips (custom post type shown on other pages) : show 1 page only, not mixed with story posts. News (custom post type) : show 1 page only, not mixed with story posts. You can see how it's started on the site mentioned above. Do you recommend scrapping custom post types & figure out way to work in posts only?

Share this post


Link to post
Share on other sites
cmunns

Well custom post types are great for creating different type of layout with added meta information. For example a real estate listing where you can enter in price, location, etc as custom data. If you still only using the same/normal content and title, etc then I would just try to work it in normally using WP functions and conditionals to get what you want. But really it's up to you and what you feel comfortable doing.

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  

×