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
0
votes
0answers
13 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
0answers
15 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
2answers
32 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
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. ...
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 ...
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 ...
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
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
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
0
votes
0answers
22 views

Different content per category [closed]

So I have filters set up for 6 different categories. And I have a filter working where you can click on each category and it displays an essential grid plugin with images for that category. For some ...
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 ...
1
vote
1answer
20 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
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
0
votes
0answers
11 views

How to fetch common posts from two feeds?

I'm trying to get an RSS feeds that combines author and category. These are the two feeds I have. https://candid.technology/author/yadullah/feed https://candid.technology/in-news/feed As you can ...
0
votes
0answers
10 views

Can I show category name in url for only one of my categories?

I have several categories in WordPress. I have set the Permalinks in WordPress Settings as https://www.example.com/sample-post/, without the category name. For some reason, I have to show the ...
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
0answers
16 views

Add custom categories and subcategories and posts as custom pages

I have to add car info section to existing website and since I need to add lots of engine types I will do it with script (this is done). I need to represent the structure Brand > Model > Year &...
0
votes
0answers
10 views

How to list posts from a sub-category that is listed in a parent category (more details below)?

I have an unusual situation I put myself in. I'm making a custom theme and I want to display a list of subcategory posts with its own URL like this: https://domain.com/category/sub-category So far, ...
0
votes
0answers
14 views

pagination 404 error, same slug home and categories

I would like to change the permalink for categories. I configured thé prefix of categories with actions I have a page for the home page wich have a slug actions All the website worked correctly. URL ...
0
votes
1answer
50 views

Change of category structure will cause two kinds of URLs for one post

I have changed the category from "file-recovery" -> "zip-file-recovery" to "file-recovery" -> "archive-and-backup-file-recovery" -> "zip-file-...
0
votes
0answers
14 views

How to show only the last two categories in a menu?

I am working with many categories and their sub-categories (sub items). I felt the need for a customization, but I could not achieve exactly what I wanted. Normally, categories and sub-categories are ...
0
votes
1answer
44 views

Automatically redirect a page to a category that share the same slug

This question shows me how to redirect a category to a page that share the same slug, but how would I redirect a page to a category with the same slug? e.g. abc.com/slug ---> abc.com/category/sub/...
0
votes
0answers
12 views

How can i add service category here? [duplicate]

I am using a theme called StartNext on wordpress, which has an option for adding services with a specific category. It uses advanced custom fields plugin for this. But when I try to add new services ...
0
votes
1answer
35 views

Incomplete term slugs output from a foreach loop with get_the_terms

I'm using this PHP to get all the product category slugs on a single product page: global $post; $terms = get_the_terms( $post->ID, 'product_cat' ); if(is_array($terms)){ foreach ($terms as $term) {...
0
votes
1answer
45 views

How do I attach a page to a category similar to how we attach media to a post?

Is it possible/how do I to attach a page to a category similar to how we attach media to a post? ps. I'm not asking how to assign a category to a page. update: I need to attach a specific page ...
0
votes
1answer
21 views

How to import nested categories from XML file?

We're importing an eXtended RSS file generated by WordPress thru the native Importer: Tools: Import in the WordPress admin panel Importing parent posts is straightforward, by defining the respective ...
0
votes
0answers
15 views

Ignore the Ad on Specific Categories

I don't want to display the ad in a few posts for a specific category (cat1, cat2). Here's the ad code to display the ad on single.php <?php get_template_part( 'template-parts/ads/below-header' ); ?...
0
votes
2answers
26 views

Display all Categories

I use this to display all categories: <?php $args = array( 'child_of' => 0, 'current_category' => 0, 'depth' => 0, 'echo' => 1,...
0
votes
0answers
16 views

Automatic duplicate/copy of post to a related page in WordPress

I have a website about introducing softwares and apps. I created pages and so menus (named by categories). I set my WordPress setting homepage to latest posts. I create posts and give them categories ...
0
votes
0answers
10 views

How to exit out of delete_categories and stop action?

I've set up my category where it has a term_meta 'author' in which the value is in the form of an array. All authors can see which categories they have in their backend but how do I make it so that if ...
0
votes
0answers
9 views

Post meta not working

I'm trying to set custom category and post meta but I think they are somehow blocking eachother. $post_tarjousid = wp_insert_post($post_tarjous); $category_id = 22; $taxonomy = ...
0
votes
1answer
13 views

Filtering blog posts by category

I'm pretty new to theme development, and trying to put together a new theme. On my site, I'd like to set up some categories for the various blog posts. Easy enough. Then, I'd like to provide the user ...
0
votes
1answer
19 views

How to add tags under categories

How to add specific tags under categories on Wordpress Main categories on my blog example.com/recipes example.com/fashion example.com/beauty example.com/life I want to add tags under this recipes ...
0
votes
0answers
14 views

custom wp_list_categories in single.php

I have created a custom WordPress theme, and I am customizing my post page (single.php). I would like to display the parent and child categories and sub-child related to the post (wp_list_categories) ...
0
votes
0answers
15 views

Wordpres category management

I would like to know, if it is possible to manage categories like how we do with atributes. I have about 500 categroy and subcategories and when I enter category section in admin dashboard, I see a ...
0
votes
0answers
14 views

How do I edit the terms output args or array data?

This correctly prints the terms with images but the wrong order: <?php $terms = get_the_terms( $post->ID , 'wpsl_store_category' ); foreach ( $terms as $term ) { echo '<a href="'...
0
votes
0answers
63 views

Add a product category to a specific product via a button

I want to add a button to product page when those products are in the category"expire". This button has to add a category. I search on web a solution and I found a code. I modified this code ...
0
votes
0answers
11 views

How display related post only in Default category on single

I have a website with lot of post. I use 3 or more category for my post. I wanna display post only for the "default category". I try this one but work with all category not only Default. If ...
0
votes
0answers
17 views

how to show all posts of each category in pages

Although found many questions and answers about showing all posts in categories, I can't achieve this: Show all posts from each category in as many page as my sites glows. Let's says we have a site ...
0
votes
0answers
28 views

Custom Post Type same name as Category

I have a general question. I'm using the plugin Custom Post Type UI. I named one of my post types marketing. However, I named one of my categories marketing too prior to installing the plugin. My ...
0
votes
0answers
21 views

List sub categories and corresponding posts of a parent category

I'm looking to list my subcategories and related posts under a parent category page. For reference, I have 3 parent categories: Baby, Toddler and Preschool. The 'baby' category page WORKS with the ...
0
votes
1answer
58 views

Display a list of random terms from custom taxonomy with shortcode

I try to output a list of terms from my custom taxonomy. I am almost sure I was using this code snippet before, but somehow WP throws errors: shuffle() expects parameter 1 to be array array_slice() ...
0
votes
1answer
15 views

Rewrite with pagination /foo/page/2/ to posts of a given category, page 2

This add_action('init', function() { add_rewrite_rule('^foo', 'index.php?category_name=category1', 'top'); }); works and allows example.com/foo/ to display all the posts from category1. But then ...
1
vote
1answer
14 views

Issue adding sub category programmatically

i am trying to insert products from an array. The product is successfully created and the values are inserted normally except the sub-category. The issue here is that the subcategory is registered as ...
0
votes
1answer
19 views

Edit the_category (); for a hierarchical display

For my wp theme I want to use the categories as tags on my posts. Example: The problem is that the category in red must always be the parent and in gold the child. Except that returns the categories ...
0
votes
0answers
9 views

Different post slug based on archive

I need some help with my current WordPress site. The site got 6 post categories. Posts can have multiple of these categories. The slug of the posts include the category slug. For each of the ...
0
votes
1answer
22 views

How to get the last category name of a child category?

there. I've tried tons of solutions I've found in this forum before asking this. It's kind of hard for me to understand the php sintaxe. I have no idea how to do this and i've been stuck for days ...

1
2 3 4 5
94