0
votes
1answer
11 views

get parents category name and content

how can i get my parent category info in my category page. let me explain details. say like i have category like Photos Gallery one Gallery Two Gallery Three i used feature category image ...
0
votes
1answer
28 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
19 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
50 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
56 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
92 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
77 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
925 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
45 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
644 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
1k 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
72 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
107 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
243 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
106 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
244 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
65 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
999 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
557 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
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
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
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
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
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
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(); ...
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
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
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 ...
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
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
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 ...
-1
votes
1answer
560 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
65 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 ...