Tag Info

Hot answers tagged

2

The solution: $query = array( 'post_status' => 'publish', 'post_type' => 'product', 'posts_per_page' => 10, 'meta_query' => array( 'key' => '_price', 'value' => array(50, 100), 'compare' => 'BETWEEN', 'type' => 'NUMERIC' ), ); $wpquery = WP_Query($query); // return 10 products ...


1

Simply add an extra line before your for loop. For example: function get_color_dropdown($taxonomies, $args){ $myterms = get_terms($taxonomies, $args); $output ="<select onChange='window.location.href=this.value'>"; $output .= "<option value='default'>Shop by Color --></option>"; foreach($myterms as $term){ ...


1

This script is localized and registered, so you're going to need to use wp_deregister_script() instead of wp_dequeue_script(). Also, you need to use the function add_action() instead of add_filter() for this. Think of add_action as a way to inject run-able code into an existing function and think of add_filter as a way to manipulate the returned output of an ...


1

This is really a vanilla PHP/HTML question, but for what it's worth: <?php if ( $email = get_post_meta( $order->id, '_billing_email', true ) ) : ?> <li> <span><?php _e( 'Email:', 'dokan' ); ?></span> <a href="mailto:<?php echo esc_attr( $email ) ?>"><?php echo esc_html( $email ) ...


1

The Javascript you have will never run because WordPress is running this in the background as purely PHP, there is HTML to associate with your Javascript. If we look at the documentation on the pre_post_update hook it states: Called just before $wpdb->update() Which is run purely in PHP. If it's easier to see what I mean, here's the full code on Trac, ...


1

I would go about this slightly differently. Still using the wp_get_nav_menu_items filter, but first I'll build an array containing the IDs of all empty terms. Then I'll compare each of the $items to this for potential exclusion: add_filter( 'wp_get_nav_menu_items', 'wpse177082', 10, 3 ); function wpse177082 ( $items, $menu, $args ) { global $wpdb; ...



Only top voted, non community-wiki answers of a minimum length are eligible