Returns an array of category objects matching the query parameters. Arguments are pretty much the same as wp_list_categories and can be passed as either array or in query syntax.

learn more… | top users | synonyms

0
votes
1answer
379 views

Display all categories including sub categories

I am trying to display a list of all categories and sub-categories underneath that category, I have managed to get a list of all categories that are parents but am struggling to detect if it has ...
0
votes
1answer
76 views

Exclude a specific category link from archive / front page

I create posts that are used just to create an index item to show an existing post has been updated. The post I create 301 redirects to the updated post. I add these index posts to the category ...
0
votes
2answers
924 views

Trying to list terms of a custom taxonomy using get_categories

I'm using this little snippet of code to try and list the terms of a custom taxonomy for use in a meta box select box but it doesn't show anything when I implement it (Despite working with the default ...
0
votes
0answers
28 views

list first post of Child Category on Category page

This may be a bit overcomplicated but this is exactly what my client is asking for and if there is anyway to accomplish this task it would be much appreciated. I've found lots of examples of just ...
0
votes
1answer
103 views

Searchform for searching specific categories

<form id="searchform" method="get" action="<?php echo home_url(); ?>"> <input type="text" name="s" id="s" size="15" /> <?php wp_dropdown_categories( 'show_option_none=Select' ); ...
0
votes
1answer
171 views

add_settings_field (exclude categories->reading) wp_category_checklist

In settings/reading, I'm trying to add an option to exclude one or more post categories from main posts/home page. I'd like to utilize the wp_category_checklist function to create the new settings ...
0
votes
1answer
267 views

wp_dropdown_categories - remove &nbsp;

I need to remove the auto adding of &nbsp; in the wp_dropdown_categories, it causes a problem in the jQuery multi select dropdown plugin I'm using. Example value: <option class="level-1" ...
1
vote
1answer
327 views

How to display only subcategory

I have categories: -Parent category --Subcategory ---Grandcategory How i can display parent category and only subccategory(not display grandcategory). My args: $args = array( ...
0
votes
1answer
133 views

List post wit the same category but exclude parent

I have the followind code: <?php global $post; $cat_ID=array(); $categories = get_the_category(); //get all categories for this post foreach($categories as ...
0
votes
1answer
31 views

Can't iterate through 2 levels of categories

I purchased a Wordpress theme, for a restaurant. The theme uses Posts for each (food)menu entry, and Categories to segment the menu into sections. The theme is built for 1 level hierarchies. e.g: ...
1
vote
1answer
1k views

Custom widget using get_categories select menu dropdown

I have created a custom widget that is supposed to display a select menu with all the categories the blog has. I have used get_categories to compile the list. This works fine and all categories appear ...
0
votes
2answers
144 views

Get categories without post

I want to get categories that had NO post. Below is sql for getting category with post.. SELECT terms.term_id,terms.name,COUNT(post.ID) FROM wp_posts as post JOIN wp_term_relationships as rel ON ...
0
votes
1answer
91 views

My custom query not detecting the correct category

For category.php my custom query code isn't displaying the posts from the correct category. I have a parent category called 'Blog' and it can have any number of unknown children. With that in mind ...
0
votes
1answer
36 views

Re writing Category Argument

I have a theme which has a category argument, however its displaying them in the wrong order <?php $categories= get_categories('taxonomy=types&title_li='); foreach ($categories ...
2
votes
1answer
916 views

Only list categories that contain posts of a specific custom post type

I have three custom post types set up, articles, videos and photos. I am using standard categories for these post types, and sharing the categories across all post types. I am trying to create a nav ...
-1
votes
1answer
536 views

woocommerce retriving category name as div class?

I am trying to retrieve the category name of a WooCommerce product displayed in a WordPress loop and use it as the class for an li (also inside the loop). I've tried this: <div id="isocontent" ...
1
vote
2answers
469 views

get_categories() for only CPT

On the site that I am working on I have Jobs as a custom post type and Locations as custom taxonomy. The Locations are used by Jobs, Posts, and other CPTs. I am working on a small filter for the ...
0
votes
1answer
396 views

Adding Multiple “Parents” in get_categories

I am using the below mentioned code to get top 5 child categories (by number of posts) from a Parent category. The code works fine, however I need to add more "Parent" categories so that I cant get ...
0
votes
2answers
168 views

Finding the category id's on category intersection pages

I'm using category intersection pages for users to be able to filter posts by categories. E.g. http://freemapsalgarve.com/category/destinations/alvor+bars-pubs/ Here the user is filtering on the ...
1
vote
1answer
2k views

How to call in Custom Post-Type Categories?

I have our portfolio page here: http://www.slarc.com/portfolio-view/central-control-building-east-texas/ The orange links below the project title are manually inserted on the page content. Is there a ...
0
votes
1answer
922 views

get_category_parents for custom post type taxonomy

I know that we can get the parent category in normal post type by: get_category_parents($cat, TRUE, ' &raquo; '); But how can we get the parent category in custom post type? I use this for: ...
0
votes
1answer
638 views

How to list only child categories?

Is there any way to list the child categories only? I just want to filter the Parent Categories
0
votes
2answers
350 views

Child Category Image

I have some code that display's the titles of my child category posts on one of my pages: <?php $parent = get_cat_ID("photos"); $cats = get_categories('child_of='.$parent); foreach ...
1
vote
1answer
105 views

Creating a custom feed for categories that includes the first post's featured image

I'm needing a little help getting this figured out. I have a query that's not quite working right now, but I need it to create a custom feed that includes category information and then includes the ...
1
vote
1answer
1k views

How do I get the category slug from wp_dropdown_categories

This might be a newb question, but I'm not sure. I did wuite a bit of searching, but i can't find anything to answer my question... I am customizing a plugin I needed it to show a list of the ...
0
votes
3answers
506 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
7k views

Get the category from an ID of a product?

I have the ID from a product (1345) how can i get the category name of that specific product? I try $post_categories = wp_get_post_categories( $post->ID ); print_r( $post_categories ); but it ...
1
vote
1answer
102 views

Trying to add cat_ID to array for showing an image for specific Category

So OK....I might be way of but here goes. Im using a plugin that gives the post a Featured Image if its not set. So Im trying to make it that depending on in which category the post is in the Featured ...
1
vote
0answers
58 views

List posts in a category grouped by other categories?

I have posts of stores and restaurants in my area. Each post is marked by category of type (e.g. Restaurant, store) and town. What I am trying to do is create a page for each town (with intro text ...
0
votes
1answer
332 views

Display all categories as plain text

Within my loop i'm currently outputting one category that a post is assigned to as plain text. Its being used as a class name within my markup (not visible to users) but if a post is assigned multiple ...
1
vote
1answer
562 views

Parent Category link to its sub categories on different page

I am creating a magazine style wordpress site. We have multiple issues which will be parent categories and these will have around 3-5 sub categories. Every quarter we will create a new issue with new ...
0
votes
1answer
58 views

Display category and associated post listings

I am having trouble figuring out a correct loop to display the following: Category Name: Post 1 Post 2 Post 3 Post 4 Post 5 See all posts in this category --> Can anyone help me with a correct ...
0
votes
1answer
353 views

Restrict category choice in dropdown menu?

Hmmm... maybe trickier than I hoped? If this is simply impossible then please do let me know :-) Question Refinement:How can I adapt the include section of this code to use category names instead of ...
0
votes
1answer
343 views

Widgets: Show Recent Posts Only if the Posts Have Both Categories X and Y

I've been trying to create a Recent Post widget where it only show/display posts that have both categories X and Y (or more). The categories X and Y is user-defined, so I'm planning to make it look ...
0
votes
3answers
166 views

Posts from multiblt categories but featured image only in the first one, the rest to have the post title only

I'm having difficulties to set the featured image only in the first post of each category and the rest to displayed with the post title only. I manage until now to display the latest post from each ...
0
votes
3answers
565 views

Trying to add taxonomy to get_categories() but it's not working. How to fix this?

I have this template I purchased and I'm trying to customize. I added a new taxonomy category called location and I'm trying to replace the default categories being loaded in the theme with my new ...
0
votes
2answers
604 views

Category List in Theme Options Page

I am trying to create a multi-select category list in a theme options page and everything shows up but when i save the options only the last option from the multi-select box that is selected gets ...
1
vote
4answers
149 views

Echoing Categories only if they're a child of a given category

I've got posts that I want to echo after the post content the categories only if they're a child of a given parent category. Example: Parent category: Goal Child categories of "Goal": brand ...
0
votes
1answer
797 views

Category List with custom urls

How do i get the list of categories as wp_list_categories does but using get_categories and then displaying the links in a foreach loop. The reason is i want the links to point to the current page ...
0
votes
2answers
357 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
312 views

Compare current post Category in select menu

i have done this many times but not via a form so i am getting a weird issues when trying to assign a "selected" based on the current post term id... Maybe the use of get_the_category and then ...
0
votes
3answers
2k views

get_categories only getting categories in the main language

I am trying to retrieve in the "content composer" the categories of projects based on the active language. But i only get the categories off the main language, never on the other. My code is: ...
0
votes
1answer
586 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 ...
0
votes
1answer
195 views

Indenting Category list

I am using the get_categories() function combined with a foreach loop, to create a list of all the catgorys in a form. like so: $args = array( 'type' => 'post', ...
5
votes
2answers
845 views

get_terms vs. get_categories: does it matter?

I'm fairly new to wordpress and am coming across new things each day - one was today when I happened across get_terms and noticed that it was basically the same as get_category. Any particular ...
0
votes
2answers
678 views

Exclude category from category archive

I've included the code I'm working with below. I had some custom work done on a wordpress site of mine. This is a page that shows an list of the categories along with images and a short description. ...
1
vote
1answer
995 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 ...
0
votes
1answer
156 views

Define specific category name in PHP

Might be a really simple question... I am trying to pull out a category name in PHP and display it on my page. I have multiple category sections on this page, and each need to pull their respected ...
0
votes
1answer
988 views

Category 'pad_counts' & 'parent' conflict

Below is the current loop I have setup: <?php //start products category loop $args = array( 'hide_empty' => 0, 'parent' => 0, ...