Post type no single page

First, before you start, just reflush your permalinks. It is sometimes strange why the Template Hierarchy fails. You code checks out, and should in theory work. Everything checks out, and to make sure, I tested it on my side. You can use this work around to “force” wordpress to use a template. Here we would … Read more

Create a list of posts with topic headdings

OK I got it working. Not sure if it is the best way but I thought I would add a reply anyway. Set up the information needed for the custom loop using $args = array As described in http://codex.wordpress.org/Class_Reference/WP_Query $args = array( ‘post_type’ => ‘product’, ‘meta_key’ => ‘wpcf-topic’, ‘orderby’ => ‘meta_value’, ‘order’ => ‘ASC’, ‘posts_per_page’ … Read more

What file have I to create in my custom WordPress theme to show all the post belonging to a specific category?

A custom template for one specific category should be named category-slug.php where “slug” is the WP slug for the category. WordPress will automatically use this file to display the archive for that one category. You could also name it using the ID of the category. If your category is “legacy-posts”, then your template file should … Read more

Get latest post from all categories except one

Your code doesn’t make sense to me. The easiest way to do this is to use get_categories() to get all the categories, and use the exclude parameter to exclude the category that you don’t need. You can then feed that back into a new WP_QUERY Example $categories = get_categories( ‘exclude=ID_OF_CATEGORY’) foreach ($categories as $category) { … Read more

is_page() and is_page_template() not being differentiated

Your code will never get to the is_page_template() if statement because is_page_template() can only be true when is_page() is also true. It also looks like you’ve got some muddled elseif syntax (I think that’s what you want?) and some generally inefficient code that repeats a lot. I’d do this: <?php if( is_page_template(‘right-sidebar.php’) ) { // … Read more