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
0answers
217 views

Dynamic Subcategories in dropdown list

How do I Create Dropdown list of subcategories? Example: Category1 -Subacategory1(dropdown list) --SubcategoryA --SubcategoryB --SubcategoryC -Subacategory2 -Subacategory3 my code ...
2
votes
1answer
770 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
488 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" ...
0
votes
0answers
69 views

Dynamic category load

I know basic wordpress coding. <?php $category = get_the_category(); echo $category[0]->cat_name; ?> this returns the current cat name in single.php. Now i want to load 'category_name ...
1
vote
2answers
364 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
353 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
161 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
1k 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
762 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
465 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
291 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
100 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
967 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
417 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
5k 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
90 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
54 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
303 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
481 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
332 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
324 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
157 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
502 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
499 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
138 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
681 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
295 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
275 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
1k 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
542 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
165 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
797 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
550 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
868 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
144 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
890 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, ...
-1
votes
1answer
468 views

how to set category name for a post

how to set category name for post: this is my code ,this is not working ,why? $post_title = $vname; $categ='category name'; $post_content = '[newpage link="'.$videos.'"]'; ...
0
votes
1answer
32 views

get IDs from links categories

How can I get the IDs of all my links categories? I'm writting a plugin to bookmark more easy using wp_insert_link() function. Any ideas?
0
votes
1answer
63 views

Getting categories to change appropriately when using $cat = ' ';

The code below is based on a couple of forum posts from a couple of places. To a certain extent, it works. The issue I am having is that it only shows "Activities", no matter what parent category I'm ...
0
votes
1answer
340 views

List of categories instead of dropdown menu selector in admin options

I am using the following code for in admin area for theme options $categories = get_categories('hide_empty=0&orderby=name'); $tz_wp_cats = array(); foreach ($categories as $category_list ...
1
vote
1answer
226 views

List all categories in options

I used to use the following code to make the list of all categories: foreach($categories as $cat) { print '<label>'.$cat->name.'</label>'; print '<input type="text" ...
1
vote
1answer
223 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( ...
1
vote
0answers
257 views

Why is my 'list_terms_exclusions' filter function timing out? [closed]

Why is my function timing out? When the issue was first noticed I added wp_defer_term_counting('true') to delay that process but to no avail. /* Filter category from get_categories and ...
3
votes
2answers
5k views

get_categories hierarchical order like wp_list_categories - with name, slug & link to edit cat

I need to find a way to list all categories - empty or not - in a hierarchial list - like wp_list_categories - also showing the slug, cat name and a link to edit in the admin. Here is what I have so ...
0
votes
2answers
1k views

How to exclude categories from get_categories() select list inside a widget admin panel

I have a widget that I need to add a category select list to. The end user should be able to select a category and I need to save the category ID with the widget. I've hit a stumbling block in that I ...
0
votes
1answer
1k views

pages meta box - get_categories dropdown

I created a meta box with a dropdown list which consists of all existing categories. The administrator of the page should be able to choose one of the categories out of the dropdown list which will ...
0
votes
2answers
111 views

Categorie parents and childs displayed

I'm trying to create a menu directly hard-coded, basically I need to display the parent category and below its child categories, however I have to do this several times meaning something like this: ...
1
vote
1answer
280 views

List Sub-Categories of a Parent Category

I need to be able to list categories that are the sub-category of a specific category that is a sub-category of a primary category. So something like this: Print Categories where ParentCategory = ...