Limit a search box by CPT + taxonomies, in only one page
Limit a search box by CPT + taxonomies, in only one page
Limit a search box by CPT + taxonomies, in only one page
Need help with conditional logic for menus
How to Save Category and Delete Category in same Function
There is a working example that only counts posts that are associated with both categories. This is tested with 3 posts, not 5000. function count_posts_with_categories($cat_ids) { global $wpdb; $cat_count = 0; // A subquery to get all posts that are assigned to each category $subquery = “SELECT object_id FROM $wpdb->term_relationships WHERE term_taxonomy_id IN (” . … Read more
How to add a php package to an existing wordpress website
undefined variable in php
It has nothing to do with child themes, the problem is here: add_action(“wp_ajax_nopriv_x_before_process”, “x_before_process”); Notice the nopriv, this is for logged out users, but it’s likely you are logged in This needs adding: add_action(“wp_ajax_x_before_process”, “x_before_process”); Note that this would not have been an issue if it was built using a more modern AJAX API such … Read more
plugin update in WordPress is basically removing it and installing again, so there is no special hook for this action. So this hacky solution is the best one: Save in options your last version On init, check if current version is newer than saved version If yes, perform your SQL actions
How to add SKU and remove product title from WooCommerce url?
function preprocess_mycomment($commentdata) { $existing_comments = get_comments( array(‘post_id’ => 31691) ); // I run the code for one specific page only foreach ($existing_comments as $comment) { $previous_comments = $comment->comment_author_email; // email address send by the current poster if ( $previous_comments == $commentdata[‘comment_author_email’] ) { // comparing the current email address with the previous ones in database. … Read more