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
2answers
22 views

Show all sub categories?

Is it possible to show all child/sub categories of all parent cats? I have the following hierarchy: Parent Cat/Tax -- Sub 1 -- Sub 2 Parent Cat/Tax 2 -- Sub 1 -- Sub 2 I would like to be able to ...
0
votes
2answers
50 views

How to get all unique categories for posts in loop?

I'm looking to get a plain list of the unique categories in a custom loop (only categories for the posts in the loop). I've been fumbling with some code for a bit and here's what I've got: <?php ...
1
vote
1answer
45 views

Show only first children level of current category?

I wish to display only first level of subcategories on current category page (if any). I tried this code: <?php $args=array( 'child_of' => $cat-id, ...
-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 ...
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
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
3answers
56 views

How to select posts from one category but exclude posts in another category?

I am trying to select posts that have category id 4 but exclude posts that also have category id 2 Here's what i'm trying $query = new WP_Query(array( "cat__in" => array(4), ...
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 ...
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 ...
0
votes
3answers
85 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 ...
1
vote
4answers
1k 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
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
1k 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 ...
2
votes
2answers
2k 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
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 ...
2
votes
1answer
120 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
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
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
272 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
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 ...
-1
votes
1answer
1k 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
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 ...
0
votes
1answer
462 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
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
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 ...
0
votes
1answer
112 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
147 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
92 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
965 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
549 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
496 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
2answers
170 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
963 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
684 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
363 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
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
524 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(); ...
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
1answer
342 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
604 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
368 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
350 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
595 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 ...
1
vote
4answers
151 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
828 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
375 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 ...