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
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
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 ...
0
votes
2answers
186 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 ...
1
vote
1answer
112 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 ...
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 ...
0
votes
1answer
37 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
28 views

Widget dropdown always displays first option

I have a custom widget that I have made but whenever I change the dropdown value it always reverts to the first option when I save the widget. How can I have it display whatever option the user ...
0
votes
1answer
25 views

Show category with link

I am trying to show the category of posts with link to its page, so I used this code but I don't know What's wrong with it. It is only showing the category without link. <p ...
0
votes
1answer
82 views

Search in particular category in wordpress

I am currently using the JSON API to get the data from wordpress http://wordpress.org/plugins/json-api/other_notes/ The plugin helps to retrieve the wordpress post data in JSON format I notice that ...
0
votes
1answer
66 views

Get a list of categories ids

I'm working on a portfolio with filters based on custom post type. That filters must display only categories for the posts that are displayed in the portfolio, since user can specify them by id in the ...
0
votes
1answer
40 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' ...
0
votes
1answer
46 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
82 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
1answer
142 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
119 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
78 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
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 ...
0
votes
1answer
603 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
201 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', ...
0
votes
1answer
33 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?
1
vote
0answers
26 views

Get the category is not working on url

Although this is my first post but i have been coming here for answers so I know the rule and this isn't a duplicate because i have tried whatever i could but couldn't seem to get my codes to work. ...
1
vote
0answers
22 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 ...
1
vote
0answers
614 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 ...
1
vote
0answers
59 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
0answers
17 views

Related sub category posts with thumbanils

I want to show sub sub category posts and title Like Parent Cat Sub Cat Sub Sub Cat <--- I use the following code but shows me all posts from Parent cat , sub cat and sub sub cat posts. ...
0
votes
0answers
6 views

How to Create Category Template list Subcategory?

im have database category -Category 1 --S1 Category 1 --S1 S1 Category 1 --S2 S1 Category 1 --S2 Category 1 -Category 2 --S1 Category 2 -Category 3 How to create check in Category as: Is go to ...
0
votes
0answers
39 views

Get parent category name and content

How can I get my parent category info in my category page. Let me explain details. Say like I have a category like Photos Gallery One Gallery Two Gallery Three I used feature category ...
0
votes
0answers
38 views

How to use get_categories results called in header.php on the homepage as well without calling the database twice?

I have a Wordpress blog with multiple categories and I have to display the last two posts of certain categories(not all of them) in the header. This is so as to have this information available ...
0
votes
0answers
61 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 ...
0
votes
0answers
26 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
253 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
0answers
66 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 ...
0
votes
0answers
30 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 ...
-1
votes
0answers
28 views

Define specific color for each category_post

I'm looking to achieve something quite special and I can not manage to see where should I start, I need the same menu system has this website ( which is done with wordpress also, using reverie ...
-2
votes
0answers
21 views

display a string of all category childrens in the the current post

This is my code $parent_id is the current post category id foreach((get_categories('child_of=' . $parent_id .'')) as $categoryy) { if($categoryy->parent ==$parent_id){ echo ...