New answers tagged

0 votes

How to set Noindex to all wordpress pages in a catergory?

This question is old but answer can be updated. If you use WordPress version 5.7.0 or newer, you can use filter hook wp_robots. add_filter('wp_robots', 'mypluginRobotsFilter', 10, 1); function ...
vee's user avatar
  • 231
0 votes
Accepted

wp_update_post breaks my function

Found the answer thanks to Jacobs comments + this similar thread: I had to use remove_action() WITH matching priority, like this: function booking_meta( $post_id, $post, $update ) { if ( ...
joxyzan's user avatar
  • 13
0 votes

Function attached to cron job not running but will run if called manually

DMTlo posted a helpful bit of insight that helped me to get on the right track and get the cron properly set up and remove old instances of the cron with wp_clear_scheduled_hook as I was testing. ...
grzybowski1911's user avatar
0 votes
Accepted

How to call a logging function from a generic utility plugin from another plguin

Assuming that I have the utility plugin, and the my_error_log() function is there, how can I call it from anywhere in my other plugins? By calling it, there are no special steps How can I be sure I ...
Tom J Nowell's user avatar
  • 58.2k
0 votes
Accepted

How to get next day date of a specific day

Use the parameters of the shortcode with lowercase: [recurring_event short="Wed" full="wednesday"] Try to follow the next code: // NAV: Custom Code function ...
DmtLo's user avatar
  • 36
1 vote

Function attached to cron job not running but will run if called manually

It looks like the time() was not set correctly in the first iteration of the function wp_schedule_event; First, remove this task from the queue by adding a function wp_clear_scheduled_hook and reload ...
DmtLo's user avatar
  • 36
0 votes

Modify the permalink structure for a specific category

Kofeigen, thank you very much for your help. You were essential for the code corrections. Here is the final code, implementing specific redirection to the 'news' category. When the URL is hacked, it ...
Jader's user avatar
  • 1
0 votes

Modify the permalink structure for a specific category

A user posted several correction ideas; unfortunately, they were deleted, but I managed to remember some things and apply them to the code. The 404 error no longer appears; now it generates the ...
Jader's user avatar
  • 1
0 votes

Modify the permalink structure for a specific category

UPDATE The answer below was temporarily deleted because I noticed that while it works to display the desired post, it also displayed "false positives". If the name query variable is used (...
kofeigen's user avatar
  • 281
0 votes

Ajax call always returns 0

important think do,hook action correctly add function.php i face same issues ,i try this all methods,but simple think i missed require my action file to functions.php add_action( '...
nagaraj's user avatar
0 votes

Add custom css to specific user

In the code that you proposes the selector only works if previously added the attributes in the HTML. It is easier if you load a specific stylesheet just for certain users: Create a new CSS file with ...
JacoboFB's user avatar
0 votes

Limit posts only on home page - ideally in functions.php

New easy solution (WordPress version 6.4+) for block themes. Just edit the home page template, click on the Query Loop block (or add one), then click the Settings button and change the Items per page ...
Reddalo's user avatar
2 votes
Accepted

Mixed results with is_page() WordPress function, when using $this, or self

You've shared that this is how the member variable is defined: class PropertySearch { private static $listing_details_template_name; This means it is a private static variable and can be accessed ...
Tom J Nowell's user avatar
  • 58.2k
0 votes

Gutenberg disallow certain custom blocks but keep all core blocks?

Unregistering blocks can cause issues, especially if you operate using a whitelist instead of a blacklist. When an update switched the core/list block to use core/list-item inner blocks the editor ...
cbirdsong's user avatar
  • 117

Top 50 recent answers are included