The get-categories tag has no wiki summary.
0
votes
1answer
16 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
47 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
30 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
27 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
18 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
0answers
119 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
74 views
Only list categories that contain a 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
92 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
19 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 ...
0
votes
1answer
92 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
97 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 ...
-1
votes
0answers
58 views
get post types category links
I'm trying this to output the links from the post_type category.
<ul class="inline-catalog" id="i-cat">
<?php
$args = array(
'type' => 'product',
...
0
votes
2answers
83 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
301 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
187 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, ' » ');
But how can we get the parent category in custom post type?
I use this for:
...
0
votes
1answer
129 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
129 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
67 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
264 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
117 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
2k 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
60 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
44 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
125 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
213 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
43 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
270 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
228 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
105 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
0answers
133 views
Listing categories on multiple columns with sub categories in accordion [closed]
I need a page template where contain all categories with child categories.
Parent category will split within 3 column and parent category name will be accordion tab. If I clicked to the category name ...
0
votes
3answers
249 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
292 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
103 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
356 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
180 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
177 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
2answers
670 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
380 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
91 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
588 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
208 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
599 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
548 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
115 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
603 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
217 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
28 views
get IDs from links categories
How I can 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
52 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
275 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 ...
0
votes
1answer
172 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" ...