Unanswered Questions
2,811 questions with no upvoted or accepted answers
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
51
views
Prevent Deletion of Blogs
I'm trying to prevent the deletion of blogs in a WordPress Multisite installation. There is already a plugin that does this, but it uses wp_die() as the solution, which in my scenario does not work.
...
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
Add custom buttons with custom actions in Edit Post screen in WordPress?
I am creating something for a client and I have a Class that I created with a Custom Post Type called 'PuSH Feeds' and when the user adds a new post and publishes it they can then click on one of two ...
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
0
answers
193
views
Is there a way to prevent wp_head from outputting self-closing tags?
I'm a beginner in WP development, so maybe I'm missing something obvious.
Is there a way to prevent wp_head from outputting self-closing tags?
Here are two example lines taken from my website:
<...
3
votes
1
answer
5k
views
Is there a Woocommerce hook that fires when applying a coupon but before checking if it's valid?
I want to add an item to the cart (that same item gets discounted with the coupon) upon using a coupon code (with a hook).
E.g. when using the coupon code SAMPLECODE, a product is added to the cart ...
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 ...
3
votes
0
answers
388
views
Remove elementor header and display default theme header
I am using Elementor pro and I am using Tabor wordpress theme(Here theme link: https://themebeans.com/themes/tabor/). I create custom footer within elementor pro and I noticed that the default theme ...