epicnic Posted December 5, 2010 Report Share Posted December 5, 2010 I watched the custom post types (thanks Ben for the nice work) videos and had an idea for my own blog. I sometimes get asked to write a review on my blog about music, games, books, ... When I do such a review it's just a normal blogpost among the others. I had the idea to create 3 custom post types: muziek (music), boeken (books), games. I want to use the custom post types to get a nice overview of everything I reviewed in a certain category (post-type). I want http://epicnic.be/?post_type=muziek to show a overview like in the videos of Ben where It shows just a picture and a rating of the reviewed product (in this case the music). Now I know i can do this by using an if statement which checks if get_post_type == muziek and tweeking the css to align everything in a grid. Now my prolbem is that if I include the music post types posts in my normal blog It should still display them like a normal blogpost. Is there maybe a function I can include in my if statement that could solve my problem? Note: I didn't use custom taxonomy because my post-types itself are the only "taxonomy" I need. Edit: I tried to use the is_home() and the is_front_page() function but when I do this on http://epicnic.be/?post_type=muziek it also returns value "1" Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 6, 2010 Report Share Posted December 6, 2010 Hmm. I must have missed this post. I'll reply when I have time later this evening. Quote Link to comment Share on other sites More sharing options...
epicnic Posted December 6, 2010 Author Report Share Posted December 6, 2010 Looking forward to it. If you need more info just shout. i tried a few other things but with still no succes. So any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 7, 2010 Report Share Posted December 7, 2010 I would probably handle this by creating a page template with a custom query. This would probably be helpful http://www.wpbeginner.com/wp-tutorials/how-to-create-a-custom-post-types-archive-page-in-wordpress/ and this section (bottom of the page) talks about custom queries: http://codex.wordpress.org/Custom_Post_Type To be honest, there are still things about custom post types that confuse me a bit, so there may be a "better" way to do this that I don't know about yet. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 7, 2010 Report Share Posted December 7, 2010 This plugin might also be useful: http://www.cmurrayconsulting.com/software/wordpress-custom-post-type-archives/ Another link: http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page Quote Link to comment Share on other sites More sharing options...
epicnic Posted December 7, 2010 Author Report Share Posted December 7, 2010 The link about custom post archives is probably the solution I seek. It's a bit strange that wordpress can show site.com/movies/walktheline as a one-custom-post-page but when you try site.com/movies/ you get nothing as logic as an archive of all your custom posts. Thanks for the links I'll try this one out later this week and let you know if it worked. Quote Link to comment Share on other sites More sharing options...
falkencreative Posted December 7, 2010 Report Share Posted December 7, 2010 It's a bit strange that wordpress can show site.com/movies/walktheline as a one-custom-post-page but when you try site.com/movies/ you get nothing as logic as an archive of all your custom posts. Agreed. I thought that was something that was coming in WP3.1, and I thought that based on comments I had read in the WP bugtracker that it had been put in place, but I can't track the link down and I haven't had time to experiment with it yet. Definitely check out the plugin I linked to -- it may save you a significant amount of time rather than writing everything yourself. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.