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
24 views

Getting all the associated categories of posts in a specific custom taxonomy?

Is it possible to list all the categories of posts associated with a specific custom taxonomy? For example; My custom taxonomy is Resorts. In Resorts I have Posts 1, Post 2, Post 3. Each post has a ...
1
vote
0answers
21 views

Trying to sort and display categories(not posts) by custom field: 'order'

I'm a WordPress rookie. I've added a custom field to my "Category" taxonomy. The custom field is "custom_order" and its purpose is to hold a number so that my categories can be sorted and displayed in ...
0
votes
0answers
26 views

How to display only the posts with category that match the current page URL

I'm trying to get the loop below to display only the posts with the name that matches the current page's absolute name. E.G: if the URL of the current page is mysite.com/current, then the post to be ...
1
vote
0answers
17 views

Show category name and new articles and display page numbers. What function to use

Show category name and new articles and display page numbers. What function to use. Ex. cat name 1 -listcat1 1 update -listcat1 2 update -listcat1 3 update -listcat1 4 update cat name 2 ...
0
votes
0answers
21 views

Secondary loop cuts off at 10 posts?

I have a loop to get a tag name from the URL slug, and then show all the posts, grouped by category, that matched that tag. It works, but I recently noticed it only shows 10 posts despite my setting ...
0
votes
0answers
32 views

wocommerce : list sub category of parent category on current category page [on hold]

In WooCommerce, if there is no subcategory of the current category, then it display the subcategory of the parent category. I tried following code: $args = array( 'type' => 'products', ...
0
votes
1answer
83 views

Get categories list with category name in custom WP_List_Table class

Im building a plugin and i made custom wp_list_table class to suit my needs and display items with native wordpress look. The problem is that i can't get to list categories with categories names. I ...
0
votes
3answers
52 views

How to show more than 5 posts?

I am running code that shows child categories, and all posts in the child categories. But if there are more than 5 posts in a category, only the 5 newest are shown. How can I show all, or at least ...
0
votes
4answers
269 views

Display Image for a category using get_categories, or show an image from any child post

I am using get_categories to list the child categories of a parent category. I want to add an image to the child categories, using the get_categories output. I can either take the featured image ...
0
votes
1answer
28 views

Custom taxonomy list in Worpdress

I just registered following code in my function add_action( 'init', 'create_resources_taxonomies', 0 ); function create_resources_taxonomies() { $labels = array( 'name' ...
1
vote
2answers
48 views

How to display a list of categories

I'm trying to set up a list of categories with clickable links to that category. I've looked at: Display list of Sub-Categories and the posts they contain, within one main Category and am not ...
0
votes
1answer
29 views

Getting parent category hierarchy as objects from category template

What is the best way to get the hierarchy of parent category objects from the category.php template, when there is no post as such. The function get_category_parents() returns a string not the ...
0
votes
1answer
51 views

Display current category title on category page

Using the following code in a category template, but instead of showing the current category page that I am on, it displays the first category of the first post. For example on Food category page it ...
1
vote
2answers
154 views

How To Get Parent Category Slug of Current Post

My theme has styling by category using the following code, which inserts the current category's slug as a CSS class. <div class="CategorySpecificStyle <?php $category = get_the_category(); ...
0
votes
1answer
42 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 ...
2
votes
1answer
80 views

get custom post type categories

From http://codex.wordpress.com: $categories = get_categories( $args ); $args = array( 'type' => 'post', 'child_of' => 0, 'parent' => ...
0
votes
1answer
44 views

Wordpress get_categories & listing recent post thumbnail

I'm trying to get a page to list all the child categories and then display their name and a thumbnail from the most recent post in that category. This is the following code I've got, it appears to be ...
0
votes
1answer
43 views

Show parent categories of the current category

this code returns the parent categories of the current category with links separated by '»': echo get_category_parents( $cat, true, ' » ' ); will output: Internet » Blogging » ...
1
vote
1answer
34 views

Getting category before saving post

I am using the filter "wp_insert_post_data" to decide what to save to the database. I need to know which category has been picked before saving the post. How can I get to know the category that has ...
-1
votes
1answer
87 views

Get only the top level categories using get_categories() without foreach loop

Very simple Question: Here is my get_categories() code: <?php $args = array( 'show_option_all' => '', 'show_option_none' => '', ...
0
votes
2answers
530 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 ...
0
votes
3answers
53 views

Any kind of custom post type in the front page and in the archive listing

I have a custom post type:products to have my post from my custom post type i have changeed these codes <?php $post_count = 1; ?> <?php if (have_posts()) : while ( have_posts() ) : ...
0
votes
0answers
211 views

Custom fields setup when category selected filter subcategories

Hi all I have custom taxonomies and custom user input fields for submiting their classifieds. So what I was intending to do is: users should select category, I want to make it able when user select a ...
0
votes
1answer
197 views

Get terms for a specfic post from multiple taxonomies in custom post type

I have created Custom post type 'references' and two taxonomies under this e.g "Custom Taxonomy A" have Categories "Cat-a1" , "Cat-a2".... "Custom Taxonomy B" have Categories "Cat-b1" , ...
0
votes
1answer
113 views

get cat id is not working from custom taxonomy

I have a custom taxonomy "city". I am having a hard time to get cat id. the number. It's also custom post type "job" This works only for default category under the default post. $provinceID = ...
0
votes
3answers
400 views

How to order the get_categories result

I read the documentation of the codex but i can't order the get_categories() result just like parent,childrens. I have these kind of categories' three: -Events - Music - Culture - ...
0
votes
1answer
74 views

Hide categories from frontend, but not admin / post editor

I'm using the following code, placed in the functions.php of my theme, to hide certain categories used to organise posts and populate sliders from the posts themselves and their category listings: ...
0
votes
1answer
44 views

How do I get the parent category if I know the child category?

So Ive got this function here that creates a drop-down menu from only the child categories, it works great. The problem is that I need to get the parent categories name and assign it as the value of ...
0
votes
1answer
42 views

Loop Problem: Displays same set of post for all categories

So, I have 2 loops, one inside the other. The first to get the category titles, the second to display a few recent post from that category. Problem: Category titles display fine, but the recent post ...
0
votes
1answer
160 views

WooCommerce Hiding A Certain Category From Being Displayed On Single Product

If I go to wp-content/themes/theme-name/woocommerce/single-product/meta.php then I see this code:- <?php /** * Single Product Meta * * @author WooThemes * @package ...
0
votes
2answers
99 views

Display Random Thumbnail from Category

I have a feeling that I'm on the right track, I just don't have enough solid PHP knowledge to get much further than where I'm currently at. I'm currently using the following code to return a list of ...
0
votes
0answers
11 views

How to make category page as the home page? [duplicate]

In this forum I´ve found this thread http://bit.ly/17IuDBh but using the code in my WP MAXX theme doesn´t work. <?php query_posts('cat_id'=>'3');?> <--insert loop--> I have ...
0
votes
0answers
58 views

Replace get_the_category() with Hikari permalink

I want to edit my theme I have bought. I'm using the Hikari permalink plugin to set which category I want to have as the default (instead of lowest ID number). Now my theme just uses ...
-1
votes
1answer
579 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 ...
1
vote
0answers
262 views

get_categories listing foreach with children

My code for loop of categories <?php $categories = get_categories('hide_empty=1&exclude=1&orderby=slug&order=ASC'); foreach ($categories as $category) { echo '<li ...
0
votes
1answer
132 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
68 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
579 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
71 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
154 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
0answers
63 views

JSON API plugin exclude categories

When I use http://www.example.org/?json=get_category_index it shows all categories. I want to exclude some unnecessary categories from get_category_index list from the site output. How can i achieve ...
0
votes
1answer
225 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
263 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
79 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: ...
0
votes
1answer
780 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
114 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
76 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
34 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 ...