0
votes
1answer
43 views

How to check if a post is in categories x,y,z inludint their subcategories

I am trying to check whether a post is in categories X, Y, Z (including the subcategories within them). This is the piece of code I have tried in my single.php: if ( in_category(array( '1', '2', ...
0
votes
1answer
113 views

Single.php Category Post Count

I have the following code in my single.php file: <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); next_post_link('%link', 'Next', TRUE); ...
0
votes
1answer
24 views

Display Referring Category on single post?

My site is built in such a way that every single post (in a custom post type) is accessed via a category archive (custom taxonomy). Every post may have more than one category assigned, but I want to ...
0
votes
0answers
214 views

If in_category not working for multiple single.php pages

I searched far and wide (on here & Google), reading about how to have multiple single.php pages for different categories of posts. The consensus was to do something like this: <?php /* ...
0
votes
1answer
99 views

How to Highlight current category on category and single page template?

On Wp Forums, I found a code that shows categories with images and it works very well. But I couldn't figure out how to highlight current category on category.php and single.php Here is the code that ...
0
votes
0answers
79 views

Modify / Rewrite single template url structure

Is it possible to add the post category name to the the WordPress single template url structure if i am not using category pages to build the site menu? from www.domain.com/single-post-title to ...
0
votes
1answer
45 views

How can I check which archive has referred the single? [closed]

I have a single page that displays one and only one category of the post that is showing. However the post can have more than one category. If the user arrives from a category page I want to show ...
0
votes
1answer
83 views

Using custom templates for post_is_in_descendant_category

I'm using this function on functions.php and the goal is to call a specific template for any post inside a main category but this isn't working when I need to call a generic template for any other ...
0
votes
1answer
2k views

Single.php - Get Current Parent Category

The Problem I'm trying to display the current parent category title with the post title right under it. The problem is, I can't seem to get the posts current category inside or outside of the loop. I ...
0
votes
1answer
687 views

Single.php Active Category Class

Currently by default (I believe) when you're on single.php, Wordpress doesn't add a "Active" class to the blog category you're viewing the single post in like it would for pages or if you're on the ...
1
vote
1answer
810 views

Using wp_list_categories like the the_category (showing just current categories of a post)

fromi'm using wp_list_categories to get an unordered list with headlines (on single.php inside the post-loop): <ul><?php wp_list_categories('title_li=0');?></ul> the thing is: i ...
1
vote
0answers
82 views

How to make the link to the category for a post go to corresponding page number in archive?

For instance, I am at http://url.com/single-post and in the post there is a link to the category that navigates to http://url.com/category/page/3/ which is the corresponding archive page that contains ...
0
votes
1answer
69 views

How do I get a single page navigation depending on the previous page?

I figured this would be a fairly comon thing. But I can't seem to find out how to do it. Or I'm just not using the correct search terms. I've got a website with a hompage that lists all my posts, and ...
0
votes
2answers
4k views

How to get category id in single.php wordpress?

I need to get category id in single.php. I tried this: $cat_ID = get_query_var('cat'); It didn't work. What should I use instead?
4
votes
3answers
1k views

Posts in multiple Categories different single.php

I am smashing my head against some code. Here is the situation: I have one post in 3 different categories, this post has to be visible in "category 1" with the single1.php, in "category 2" with ...
0
votes
2answers
559 views

Custom Single Post By Category

I'm trying to get up to speed with the terminology of the ins and outs of WordPress, so apologies. I'm setting up a full site utilizing WordPress and a custom template, basing it on TwentyTen ...
0
votes
1answer
200 views

Displaying links to all posts of the same category on the post page

I want to display the links to all posts of the same category of the current post on that page. I wrote the following code in the single.php file. <?php $categories_of_this_post = ...
0
votes
1answer
88 views

Problems with my conditionals in single.php by category

In my single.php file I would like to have a conditional that checks for the category of the post and display certain images and layout. Here is what I have: http://pastebin.com/dy6TE1yr
1
vote
1answer
574 views

in_category() works in single.php but not in page.php?

I'm using in_category(array) inside The Loop to detect whether a post is categorised into the Discussion category (or has one of a couple of slugs). This works beautifully on single.php but doesn't ...
0
votes
2answers
195 views

Can I style single post that are in multiple catergories?

I have a regular wordpress site and I am trying to make a mobile version of the same site. For the blog section, I have put all of the posts in two categories: blog and mobile. The posts in "blog" ...