Questions tagged [categories]

Every Post in WordPress is filed under one or more Categories. Categories allow the classification of your Posts into groups and subgroups, thereby aiding viewers in the navigation and use of your site.

Filter by
Sorted by
Tagged with
3
votes
2answers
2k views

Wordpress Child Category Display All Posts

I am creating a Wordpress page where all my posts in the child categories of team are displayed in a grid. I got this working with the below code. The formatting and general layout is great however it ...
0
votes
0answers
7 views

Assignt automatically two categories by author

I'm looking for a way to automatically assign two categories each time an author makes a blog post: General category (will always be the same for all authors). Author category, with de same exact ...
0
votes
0answers
23 views

Display just the Post's parent Category, not child

I want to display all post under a parent category (custom taxonomy) ONLY!. Here's what I've done so far:' <?php $custom_taxterms = wp_get_object_terms( $post->ID, 'product_type'...
0
votes
1answer
8k views

query_posts by category_name and custom taxonomy

I want to display posts filtered by category_name and custom taxonomy-term: I have function channel_init() { // create a new taxonomy register_taxonomy( 'channel', 'post', array( ...
0
votes
0answers
11 views

Customize woocommerce shortcode [product_categories]

I need to create a gallery with all product's category. The standard shortcode [product_categories] creating a gallery with image and title but I need to have also description and maybe css effects...
0
votes
1answer
2k views

Display Related Posts by "Category" "by Author"

How can I display related post "by category" "by author"? I use this code but it just displays related posts by newest posts of author, not related posts by category of author. I've done some research ...
0
votes
0answers
12 views

WordPress Default Category and Custom Taxonomy Selected Attribute not Working After Searched in wp_dropdown_categories Array

I have Three Fields in the form, first is Default WordPress Category and two custom taxonomies. When I try to Search a Single field "Selected Attribute" Works Correct but on category, ...
0
votes
1answer
3k views

Can't seem to filter wp_query by current category ID

I'm querying a custom post type ("donor") and would like to list them grouped by category (a custom taxonomy for this post type), with the category title then all posts for that category. After much ...
3
votes
1answer
2k views

Update wordpress post terms programatically

I am currently working with woocommerce for wordpress and making a custom plugin. I would like to update the product categories manually through my own admin panel, here is what I have so far: $...
0
votes
0answers
32 views

Custom front-end form for adding post - Category problem

I've created a CPT front-end form for post-adding. It has a title, description, categories, image, and a couple of custom fields connected with ACF in the backend. Everything is working, except ...
0
votes
2answers
40 views

Display sibling categories on category page

I have a category page, how do i display this category sibling categories on this page as well? I know how to display children categories: <ul class="slider-container-list sub-categories-...
0
votes
0answers
16 views

Private categories in Wordpress

How can i create private category in Wordpress? What i mean? Authors can't see the category and can't add that category to their posts but admins and editors are can see that category and add the ...
0
votes
1answer
22 views

Order category posts by last word of custom field

I'm trying to order a category page by the last word of a custom field that all of its posts have. The custom field represents a name, so the last word would be the last name. In the end, the posts of ...
3
votes
1answer
9k views

How to hide a specific category posts in my monthly archive?

I am using the twenty eleven theme in my wordpress site. In posts, I have two categories. One is blogs and other is News. The monthly archive displays the posts of all categories while I want that ...
0
votes
0answers
10 views

Categories are not available AT ALL under Menus

I installed and activated Envo Shop for my new WordPress website which is hosted on Hostinger. Everything almost is going good except, Categories which are not showing up under Appearance, Menus. ...
1
vote
1answer
253 views

Shortcodes not working in category or tag description

when Yoast plugin is enabled shortcodes not working in category or tag description I used this and this article and add these codes to the function but nothing change please help me. add_filter( ‘...
0
votes
4answers
8k views

Display only one level subcategory in wordpress

This code uses Taxonomy Images plugin to display images for categories. This code display subcategories of main category in parent category page (category.php), But I want to display only one level of ...
0
votes
2answers
864 views

Looking to exclude blog posts from category Previous/Next buttons

I'm working on some conditional elements here and I thought I had it but it's still not working right. You can see my site here. What I've done is displayed only category Legal Libation Columns (98) ...
0
votes
1answer
2k views

Sub Categories in drop down menu

I have lot of categories and sub categories. I want to add all these in WordPress menu. But i want to add subcategories aligned properly under their parent categories without drag and drop each and ...
1
vote
3answers
29k views

How to get product count with respect to categories in WooComerce

Hi I want to display all the categories of products in a loop to display them in category menu along the numbers of products each category contains. Some thing like that so far I have done this to ...
5
votes
7answers
19k views

Force Wordpress to Show Pages Instead of Category

I am trying to create a SILO structure on one of my WordPress site. I have always checked this option on Yoast SEO plugin "Strip the category base (usually /category/) from the category URL." So my ...
0
votes
2answers
621 views

How to run select query of post with category and tags?

I want to fetch multiple posts with categories and tags currently I'm using this query: $pagesize = 20; $pageNumber = 1; $mysql = mysqli_query($con,"SELECT p.post_title, p.ID, p....
0
votes
1answer
592 views

global categories - Share specific categories in wordpress multisite

I have a wordpress multisite network. So I want to share just some categories between subsites.
0
votes
2answers
967 views

Showing Subcategory's Name and Link Instead of Parent Category's

Right now my code is displaying the category name and link. But if an article is in a subcategory, I want to display the subcategory's name and link instead of the parent category's name and link. For ...
0
votes
1answer
26 views

How to show a custom taxonomy in the theme?

I have created a custom post type: register_post_type() and custom taxonomy: register_taxonomy(), but when trying to show the categories made to the post type in the theme single-{post_type}.php they ...
0
votes
2answers
2k views

Change Category Base For Custom Post Type or Posts Page

I have a few questions and I don't think the outcome I want is possible without adding a custom taxonomy and redoing a bunch of work. I have registered a custom post type - gallery - with taxonomies ...
0
votes
2answers
621 views

filter single_cat_title avoiding the breadcrumbs

I'm developing a simple plug in and I need to filter single_cat_title in category page adding some html in every category page. Just doing this: function subtitleCategory ($title) { return $...
1
vote
0answers
28 views

match keywords to a category and assign a category to a wordpress post

I have my own rss feed import plugin. This plugin has a logic for matching keywords (separated by commas) with a category, according to the description. There is a structure of categories and ...
0
votes
3answers
468 views

Change every post background based on category

Is it possible to change the background color of every post based on its category? I have tried - body.term-adb { background-color: #000; but this only changes the category page, not the ...
0
votes
1answer
17 views

Getting the category title / description returns first matching post?

I'm working on a template-part called heading which displays the page heading and an optional subtitle underneath. I have it working on pages, but on archive pages like our blog or product category ...
0
votes
1answer
1k views

How to sort custom post's category by id from the theme's function.php?

I'm wondering how to sort a custom post's categories in the selection field which I've circled in the screenshot? And I have the following code which generates category listing $args=array( ...
0
votes
0answers
28 views

How to add the .html extension to the category?

How to add the .html extension to the category? For Example www.example.com/category/category-name.html
26
votes
9answers
83k views

Get Category ID inside Category template

how do I get the cat ID inside the Template. Very important: I can not do it by the name, because we have muliple cats with the same name. Only the slug is different. If I'd get the slug, it would be ...
6
votes
3answers
12k views

get all tags from category

i'm displaying all posts by category in my template and i was wondering: is it possible to get a list of all tags used by that category? i only found out how to make a tag-dropdown but it's from all ...
1
vote
2answers
565 views

WP didn't redirect to canonical category URL

I have a problem with canonical redirect. mydomain.com/mycat is the correct category URL but the following URL works too: - mydomain.com/asdfa/mycat - mydomain.com/1234/mycat - mydomain.com/...
1
vote
1answer
892 views

How can I create a Category Index page that lists all categories?

I have themed my category.php file so it now displays all posts that belong to the category that was clicked. The URL looks like [www.example.com/category/news/]. This is good and correct. When I go ...
1
vote
1answer
9k views

Dynamic dependent Dropdown lists for categories, sub-categories and posts

I'm using WordPress 3.5. I need a way to implement a code or plugin to allow users to navigate through posts using dependent(chained) dropdown lists. In other words I would like 3 dropdown menus to ...
0
votes
1answer
1k views

How to show posts only for the last subcategory?

I have a hierarchical categories tree, meaning up to 3-4 subcategories with posts. When clicking on a category link in the home page, I am redirected to the category page. I need to check if there ...
11
votes
6answers
39k views

How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms

I want to export all Wordpress categories (no posts, just categories) from one blog to another. How can I do that ?
0
votes
0answers
37 views

Show the number of the post

I'd like to show the Number of the post near the post in a category. It's simpler to explain with a drawing than with words: My first solution was a simple counter inside the loop, but it doesn't ...
0
votes
0answers
8 views

change image on single product page with js

I tried to run over But let's not replace either the image of the zoom and all that I want to access the image itself and change it Please help me. jQuery(".wvs-attachment-image").attr("...
0
votes
2answers
571 views

Remove "All categories" from searchbar dropdown

I have been struggling with this and could not find a clear answer online. Will putting a product search bar I have a dropdown visible with all the categories you can search in. I would just like to ...
0
votes
1answer
676 views

How to display related post from same category in single.php

How to display related the post from same category in single.php. I have tried but it was not working.
1
vote
1answer
701 views

How do I share categories across selected sites in a Multisite setup

I've got a Multisite network that looks something like this: Site A Site B Site C Site D Site E and have a set of Categories like this: Category A Category B Category C Category D Category E These ...
1
vote
1answer
21 views

Show Primary Category first when I display post categories

I created some custom taxonomies in Wordpress and when I want to show the categories for a custom post type on the frontend, they're listed in alphabetical order. Is there a code for functions.php ...
0
votes
0answers
16 views

Create Miltiple Category Base

Hlo Everyone, I have a wordpress site with a category base link which look s like https://www.website.com/category/sub-category/post Now I want to have multiple categories base like https://www....
0
votes
0answers
17 views

Automatically adding tags and categories into Post Excerpt for searching

I have created a complete user front end posting system. Users post content that only they can view from a front end posting system. They can add tags and set a category. In order to be able to run a ...
0
votes
1answer
13 views

Can't get selected value from wp_dropdown_categories or get_categories

I've searched and found this and a few more. But I still couldn't get the selected name (not value as value is just a number). get_categories keeps returns an empty array. Below is the code from the ...
0
votes
1answer
774 views

Unable to get all tags from specific categories

Page in question. I'm trying to use a WP_Query(); targeting specific categories and displaying all the tags used for posts within those categories. I noticed that some tags, like truffles aren't ...
0
votes
0answers
7 views

Display default matabox of posts(add category) wordpress

I'm trying to make a custom page that will add posts. And I have a little problem. How can I display adding categories in page(in my template) for a post as in the admin panel

1
2 3 4 5
94