Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
7 views

“Categories” on my front page

I just switched to Wordpress and i want to delete (or hide) the "Categories" section that comes up in my main page. is it possible? Thank you
0
votes
2answers
19 views

Create custom Perma link

I have a page with with address localhost/ . .In the navigation bar I have a new page link named Blog. SO wheni travel to that page the link is localhost/blog . Now here is my thing ...when i click ...
0
votes
0answers
16 views

get_category_link() returns wrong url, result is `http://my_site_url.com/http://my_site_url.com/my-slug` instead of `http://my_site_url.com/category`

I am using the following code to access my categories: <?php $categories = get_categories(); foreach($categories as $category) { echo '<li><a href="' . get_category_link($...
0
votes
1answer
11 views

Return to the beginning of the results of a for loop

I am currently doing a little script (and I am rather beginner), I would like to know how to return to the result number one of a for loop after the table containing the results have been traveled? ...
0
votes
1answer
19 views

Archieve.php not loading for custom post type

I have a post with a category of blog . So i came across with this archieve.php , whereby we can edit the layout and content of a custom post type. From what I understand archieve.php contains the ...
0
votes
1answer
18 views

allow only one post in specific category

I have a category called "best post". When the editor selects this category in a post and publishes the page, a PHP routine must check if other posts have this category, and if so, this category must ...
0
votes
0answers
9 views

Relations between taxonomy terms for getting parent child nested Json objects and arrays

i have 2 taxonomies (cat) (subcat) and they have some terms(rows) for example , , i want make a relation like SQL data tables between the taxonomy terms for giving me a nested object of arrays in the ...
0
votes
1answer
12 views

get taxonomy list in a page in the wordpress

I have this code in a page in the WP for show new taxonomy <?php $terms = get_terms(array( 'hide_empty' => 'false', 'orderby' => 'name', 'order' => 'ASC', 'taxonomy' =&...
0
votes
2answers
22 views

Count category views - Is it possible?

I would like to show my most viewed categories (kind like the "WP-PostViews" plugin). I already did some research but I didn't find nothing about that. This made me think that it can't be done by ...
0
votes
0answers
11 views

Pretty product category URLs for duplicate sub-category slugs in WooCommerce

In Wordpress / WooCommerce I want the urls of product categories in a strictly hierarchical pattern even if subcategories receive equal sub-path - as it works e.g. with pages. Example: I have two ...
0
votes
1answer
28 views

Add custom taxonomy terms to Wordpress menu dynamically & append #slug to url

I have a 2 part question. This is my first post here, so apologies if I am doing it wrong. I have a custom taxonomy (created with WP Toolset) called 'Author Categories'. What I need to have done is ...
1
vote
1answer
10 views

Warning: sizeof (): Parameter must be an array or an object that implements Countable, On products pages

I have a WooCommerce WordPress Theme installed. I'm getting an error that public users can see, So I need to fix it ASAP. The error is shown on all products pages, Here is the error: Warning: ...
0
votes
1answer
34 views

Do not load the categories in Category.php

I have a CPT and each post has categories and sub categories. When I enter the Category.php page this does not print any post. <?php get_header(); ?> <div class="row"> <div ...
0
votes
0answers
37 views

Replace category titles inside RSS feed

I need to replace titles in <category> ... </ category> tag inside the default RSS feed (mywebsite.com/feed/). Of course, it would be more convenient to just rename the categories, but ...
0
votes
1answer
9 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
14 views

Change the category of all posts in it

I'm trying to make a category change of some posts by MySQL. But I am not able to give the update in the database, it is giving error when running the query. UPDATE * FROM mooca_posts LEFT JOIN ...
0
votes
1answer
34 views

How to get current post category details inside “loop”?

I have a rather simple problem I can't solve. I have custom styling for my cards and one of the elements of the cards is the category, when I access the_category() from the Loop it comes with its own ...
0
votes
0answers
20 views

How to add Load more posts in category template

I want to add load more button for posts and limit the posts to 6 function cat_ajax_get(catID) { jQuery("a.ajax").removeClass("current"); jQuery("a.ajax").addClass("current"); ...
0
votes
2answers
21 views

query_posts problem - need help

I have a taxonomy called coupon_category. In a query_post I am trying to call all posts from related custom taxonomy with the same coupon_category. If I use: <?php // show ...
0
votes
2answers
24 views

Display posts of certain categories to specific user roles

I'm working on a site for a school and the teachers all want to post the homework for their students online, but only so each student can see his or her own class's homework posted by their teacher. ...
-2
votes
1answer
17 views

Taxonomy term RestApi data 10 rows limitions

i have created a pod taxonomy(Products) in Wordpress ... i have 16 item of terms(categories) for product taxonomy ... but after going to this routes : http://...../wp-json/wp/v2/product_categories , ...
1
vote
1answer
13 views

.htaccess too many redirects based on category slug

I moved my wordpress page up a directory and also changed a bunch of categories with new names. But when I try to set a 301 redirect via .htaccess and then access that category url, the browser errors ...
0
votes
0answers
11 views

Is there a way to allow users to customize their feed view?

I run an aggregate site and it produces lots of posts throughout the day. Is there a way for me to allow users to log in and select what category shows up on their feed? So they could choose between "...
0
votes
0answers
29 views

how to remove a tag in the_category function

https://core.trac.wordpress.org/browser/tags/5.0.3/src/wp-includes/category-template.php#L0 line:195 //line 195 default: $thelist .= '<a href="' . esc_url( ...
0
votes
1answer
24 views

Number of categories slowing down the site

I had over 10K categories and posts on my WP site. Posts are created but don't have any content. I am hosting the site on mid-tier option for WP sites on Siteground. Due to a large number of ...
0
votes
1answer
17 views

How show categories in admin and get that selected to show posts in index

my problem is: I need to offer in admin a page to user select 2 categories. I have 2 containers in index.php showing some posts from some category, but i need to allow user to change what category he ...
0
votes
0answers
17 views

Query nested posts, return if top level post contains a child certain tags

I have posts sorted by two categories ('Chapter' and 'Paragraph"). The 'Paragraph' post can contain several tags. Not custom post types. The 'Chapter' has a relation (via ACF) to the 'Paragraph'. I'...
0
votes
0answers
7 views

Is there a way to allow users to customize their feed, i.e. choose what categories they see first when they log in?

I run an aggregator site and want to give people more ways to see what they want. I have it broken down pretty comprehensively by categories and think a tailored feed would make a lot of people happy.
0
votes
1answer
25 views

Wordpress the_category(); only works with message-posts not with project posts, how do I specify project categories?

The title, the permalinks & even the field of ACF do work smoothly. But the code is not reactive to project categories, when I echo wp_list_categories(); it shows the list of message posts only. ...
0
votes
0answers
17 views

How to use the meta box from edit media in attachment details for custom taxonomy

i've added a custom post Type for attachments in Wordpress and it works fine. My problem is the way of displaying (or not displaying) the terms in the attachment details of wordpress. It's only a ...
0
votes
1answer
31 views

Woocommerce product not appearing in category list page when created programatically [closed]

I am creating a plugin that will filter the products from API to our WordPress site. I did successfully created the product and automatically publish it with category and subcategory in it. http://...
1
vote
1answer
27 views

Category Page Template not Showing Posts

I am trying to get this template to work.
0
votes
0answers
31 views

Display Category yearly wise in wp

How to list the categories yearly wise in template and the taxonomy page of the category should list the posts of the selected year. 2016 2017 2018 Category 1 ...
0
votes
0answers
8 views

Quote format category page

I would like to have a category page just show quotes without links or images. like this https://demo.zigzagpress.com/xplorer/category/post-format-quote/ it displays just the quote I see they have a ...
2
votes
3answers
75 views

WP_Query with custom post_type and cat retrieving unwanted posts with the custom posts

I have a custom post type "projets" that is using the category taxonomy (so it is sharing categories with regular posts). When I call WP_Query like this: $args = array( 'post_type' => '...
0
votes
0answers
11 views

Get all subcategories IDs from categorie or categorieIDs

I'm having trouble to get an array of IDs from subcategories. My code: $cats_excluded = array_merge( array(get_cat_ID('podjetje'), get_cat_ID('personal'), get_cat_ID('nekategorizirano'), get_cat_ID('...
0
votes
1answer
16 views

How can I display categories on different pages

I am working on a theme. Woocommerce categories are displayed on home page but I need to add on shop page, product page and category page. How can I do this.
0
votes
2answers
20 views

Limit categories and it's subcategories for specific group of users

Is it possible to limit the categories so that user in a list of groups does not see these posts at all? Not even in a list of posts? I'm using the answer from here: Only show category to certain ...
1
vote
1answer
21 views

previous/next_post_link in the same sub-category?

As the title: is there a way to navigate between posts of the same subcategory using the previous_post_link and next_post_link functions? But maintaining however both the category and the sub-category ...
0
votes
1answer
26 views

wp_dropdown_categories not showing option as selected

I'm using the below code to list categories as hierarchical. On change of select options it is redirecting to the respective category pages. But it not showing the category as selected.Could any one ...
0
votes
0answers
11 views

Check to see if a post's child category also has it's parent category ticked

Is there a way I can check to see if a post's child category also has it's parent category ticked? With a warning popup when publish/update is clicked.
0
votes
1answer
33 views

Redirect category archives to pages

I'd prefer to not use the category pages of my WordPress install - my question is - does anyone see a "WordPress" contradiction or an error that might arise if I redirect "Category" pages to another ...
-1
votes
1answer
21 views

related articles using shortcodes

I want to make related articles based on the categories in the sidebar using shortcodes so that they can be placed anywhere. can you help me? thanks before.
0
votes
1answer
33 views

How do I merge WooCommerce categories with the same name?

I have duplicate product categories - they share the same name but different slugs eg., The category 'Adhesives' has a slug of "adhesives" but since updating my products via CSV import, there is now ...
0
votes
2answers
51 views

Custom get_the_password_form

I'm interested in creating a filter for pages with password protection and that have a certain category. I've placed this code in my theme's child folder in functions.php since I didn't want to edit ...
0
votes
1answer
23 views

Custom Archive Template for Multiple Categories

I want to create a custom archive template for two post categories. One of my categories is events, and the other one is courses (I have more). I already have a custom template for events (category-...
0
votes
0answers
15 views

Display post number for multiple categories

I would like to display sequential numbers that coordinate to posts in different categories i.e.: Category 1 -> Post 1, Post 2, Post 3; Category 2 -> Post 1, Post 2, Post 3). I have the code from a ...
0
votes
0answers
23 views

Change post category within pre_get_posts

I have written a filter to be called in pre_get_posts to remove posts from a category page based on a meta_key (EventDate which is in the form YYYYMMDD), which is working. However I'm struggling ...
0
votes
0answers
17 views

How to select subcategories of a subcategory

Please help me to select subcategories of a subcategory What I want is, List all subcategories "One three category" and "one two category" when I select "Musical flasher 2 pin" Could you please help ...
2
votes
1answer
51 views

Change Gutenberg category checkboxes to radios

Any ideal way how to change Gutenberg's categories checkboxes to radio inputs? I have tried using this plugin: Categories Metabox Enhanced. But it doesn't work fully well with Gutenberg, meaning my ...