Unanswered Questions
3,931 questions with no upvoted or accepted answers
10
votes
1
answer
983
views
Custom Taxonomy Endpoint Pagination using paginate_links()
The Setup
I have 2 taxonomies and 1 post type:
Post Type: products
Hierarchical Taxonomy: product_cat
Nonhierarchical Taxonomy: product_type
The product-category has a defined endpoint:
...
8
votes
1
answer
667
views
static variable loop not working in Wordpress
I have a function in my wordpress theme that deletes the first embedded video in a video post. See code below. This is in the functions.php file.
/* - function that hides first video in post content -...
6
votes
0
answers
636
views
How to load paginated post pages via ajax
Here's the case I got: I've setup post pagination for my website and everything works well. Except one thing - on every new page request all the resources are loaded again. This makes the website ...
6
votes
0
answers
248
views
Customize WordPress Media Manager - Media Window
Im trying to customize the wordpress media manager "add media" window to get it as simple as possible to use. So i want to disable/ hide the following fields/ functions because i dont need some or ...
5
votes
1
answer
12k
views
wp_query->max_num_pages always returns 0 on custom post type
Hi there I am developing a theme where I have to load some posts with ajax, in my index page everything works properly, the problem is when I need to use it on custom post type, I pass the values for ...
5
votes
1
answer
4k
views
I want to load post content by categories using Ajax
I have question.
I would like to load post content, custom post, depends on category.
So first of all I would like to have drop down menu which will list all my categories then once user will select ...
4
votes
1
answer
5k
views
AJAX handler throws 400 (Bad request) - why?
I am trying to apply a "Load more posts" function to a post loop, but I am dealing with a 400 Bad request, when admin-ajax.php is referred to.
The reference I used is this - https://rudrastyh.com/...
4
votes
4
answers
334
views
What is the Difference between directly call a function and call a function using add_action?
What is the difference between following two codes? (Directly call a function and call a function using add_action)
function pp_submit__link_form(){
if(isset( $_POST['action']) && $...
4
votes
1
answer
666
views
Custom taxonomy query for a custom post type
I have a custom post type called news with a custom taxonomy called news category. Right now I have a template called taxonomy-news_category-press.php where press is one of the news_categories. The ...
4
votes
0
answers
91
views
my function doesn't return my post from today
I'm using gravity form to create some custom post type - as events.
Everything is working great, There is some date field to setup the event from x to y date. ALl of this working great.
However, I ...
4
votes
1
answer
2k
views
has_term or in_category for Custom Post Types
I have property as a custom post type. I want to display a specific message if the property is in the sold category. To do that, I'm using the function below:
if ( has_term('sold', 'category')) {
?&...
4
votes
1
answer
104
views
Is it possible to have a taxonomy archive that lists taxonomy terms?
For example, I have a post type called foo. I can view all posts of type foo at the following url: mysite.com/foo.
I then attach a taxonomy called bar, in which the terms are foobar and foobaz.
I ...
4
votes
1
answer
1k
views
Custom taxonomy on permalink
I have a long time problem and look forward for your help.
I have a custom taxonomy of "city" (it is no hierarchical like tags).
I just would like my URLs to look like this:
/%city%/%category%/%...
3
votes
3
answers
117
views
Is it possible to automatically set the publication time to 8am on new posts?
This might be kind of funky to pull off, but does anyone have any ideas on how I could automatically set the time to 8am on any newly created post drafts? In both the Classic Editor and the Block ...
3
votes
1
answer
104
views
Changing a function in function.php to a shortcode - for listing categories of only a certain post type
I'm trying to create a shortcode that can display a list of categories. However, it should:
First, limit the results to a specific post type (based on shortcode usage)
then check to see if category ...