0
votes
2answers
2k views

Get current category id from post page wordpress

I have a problem to get category id of current post. We are using <?php get_the_category( $id ) ?> for finding out category of current post. If a post like 'demo' has 2 category like cat1 and ...
-1
votes
1answer
983 views

List only child categories a post is in, of a specific parent category

Either this is harder than it needs to be or I am just not understanding WordPress/PHP very well :( All I want to do is show the child/sub categories of a specific parent category...but only if the ...
0
votes
3answers
500 views

Sidebar limiting to 10 posts?

I have the following code inside my single.php page: UPDATED CODE <?php if (have_posts()) : the_post(); $post_id = get_the_ID(); if ( is_single() ) { $cats = get_the_category(); ...
0
votes
2answers
353 views

Display Parent Category of a Post belonging only to Subcategory

So basically, I have posts assigned to only subcategories and not to categories (this is so both of them get displayed in the premalink) and in the post page only the subcategory is displayed. I want ...
0
votes
1answer
581 views

Listing Specific Categories from Current Post with Depth

I've been on this for sometime and been having a ton of issues to find a proper way to do what I'm trying to achieve. An Example would be as follows: I have a featured Image with a rollover and I ...
1
vote
1answer
987 views

How to make multiple sections in home pulling posts category wise?

This question may look foolish to everyone or novice , but i am working on a theme . It will be basically a news publishing theme . Right now , In my home page all posts are showing one after ...
0
votes
1answer
1k views

Query only Posts from Both of Two Category?

I have 3 categories, 1.OnGoing projects(cat id='5') 2.Completed Projects(cat id='6') 3.Upcoming Projects(cat id='7') and also i have another 2 categories:(Not a Sub Category) chennai (cat ...
1
vote
1answer
233 views

Category Foreach keeps looping?

I'm using the following code to acquire all the child categories of a category and displaying the child posts of the child categories. <?php $cats = get_categories( 'child_of='.get_query_var( ...