WordPress Unknown Query
It is not hard to log queries performed by WordPress. Simplest way would be to use plugin such as Debug Bar that collects backtrace information about where in code was query performed.
It is not hard to log queries performed by WordPress. Simplest way would be to use plugin such as Debug Bar that collects backtrace information about where in code was query performed.
You’ve made no attempt to check for errors, e.g. $result may be false, also your code would fail if there was more than one result returned. So instead of using a custom table, and reinventing the wheel, use the provided APIs: get_theme_mod and set_theme_mod So your code now becomes: function asec_get_link_color( $default_color=”blue”) { return get_theme_mod( … Read more
You can use if ( is_singular( ‘POST_TYPE’ ) ) to determine the type if your singular post. Remember to change POST_TYPE to your desired type.
$wpdb->prepare shouldn’t make any significant difference. As you can see here (https://developer.wordpress.org/reference/classes/wpdb/prepare/#source), it doesn’t do much. It’s just taking care of proper escaping and formatting variables, so the final query is safe to run. So if you’re asking if there is a big difference between $wpdb->query( $wpdb->prepare( … ) ) and $wpdb->query( <SAFE_SQL> ), then … Read more
Try this hide_empty=1 it should be hide_empty=0
I am not sure what ‘be_price’ is for, but I think your $args should look like this: $args = array( ‘post_status’ => ‘publish’, ‘posts_per_page’ => ‘150’, ‘cat’ => $cat_id, ‘meta_key’ => ‘popularity’, ‘order’ => ‘DESC’, ‘orderby’ => ‘meta_value_num’, ‘meta_query’ => array( ‘key’ => ‘gone’, ‘value’ => ‘1’ ) );
I ended up using this method… http://www.lotsofcode.com/php/php-array-pagination.htm This script will allow you to take an array and paginate across multiple pages. Works good for what i need. Just working on how to number each item in the array across the pages in a descending order…
It was a bug in WordPress. Please see this track ticket #21581 for details.
if ajax returns zero, the function bound is not registered properly have a read: http://arresteddeveloper.net/woocommerce-get-variation-description-variation-select-changes/ this might point you in the right direction
You could get the categories and for each of them, you use the list category posts plugin shortcode to echo the relevant posts into a div: $categories = get_categories(); foreach ($categories as $category) { echo ‘<div>’; $cat=$category->cat_name; echo do_shortcode( ‘[catlist id=’.$cat.’ numberposts=5 ]’); echo ‘</div>’; } This goes in the ‘latest posts’ part of your … Read more