when the incoming url is a query, in which function does WP begin to work with it?

Any url that doesn’t point to a file/directory that actually exists is redirected (by .htaccess) to the index.php in the root of your WordPress install. index.php is what actually loads WordPress and its settings etc. It then calls the function wp();, which is responsible for initialising WordPress’ actually handling of the request. wp() is little … Read more

Creating a Search Array From Multiple Tables

You’ve got the right idea. If you get an array of country IDs within a region, you can pass that array to a meta query IN comparison: $country_ids = array(1,2,3); // this would be the result from fetching countries associated with a region. $args = array( ‘posts_per_page’ => -1, ‘meta_query’ => array( array( ‘key’ => … Read more

wp_parse_args & category parameter

Update 3/5: When I originally answered this question I didn’t realize that your code was almost an exact copy of the wp_get_archives function. There is nothing in your code or the original wp_get_archives code that supports categories. The function was written to get date archives and your defaults are missing the type, limit, before and … Read more

Using wp_parse_args to set up Plugin Default Settings

Try: function eddslider_options_each( $key ) { $edd_slider_options = get_option( ‘eddslider_options’ ); /* Define the array of defaults */ $defaults = array( ‘slider_insert’ => 0, ‘slider_arrows’ => 0, ‘slider_bullets’ => 0, ‘slider_effect’ => ‘fade’, ‘slider_theme’ => ‘default’ ); $edd_slider_options = wp_parse_args( $edd_slider_options, $defaults ); if( isset($edd_slider_options[$key]) ) return $edd_slider_options[$key]; return false; }

Remove h2 Tag in screen_reader_text

There’s a couple issues. 1) You’re not supposed to put HTML inside most translations strings ( such as this ). 2) The screen_reader_text argument does not accept HTML at all, you need to filter the HTML by using the following hook: navigation_markup_template – Filters the navigation markup template. /** * Modify the given HTML * … Read more

Custom Taxonomy Archive BUG

as mentioned by @mmm you loop over the terms and in each term you loop over each project – however I think this is what you wanted to do: $terms = get_terms( array( ‘taxonomy’ => ‘residential_project_types’, ‘orderby’ => ‘count’, ‘hide_empty’ => true ) ); foreach( $terms as $term ) : ?> <a class=”property-thumb-link” href=”https://wordpress.stackexchange.com/questions/264897/<?php echo … Read more

How to orderby meta_value_num with dollar ($) sign

You could also use the posts_orderby filter: function wpse155827_posts_orderby_price( $orderby ) { return str_replace( ‘wp_postmeta.meta_value’, ‘substr(wp_postmeta.meta_value, 1)’, $orderby ); } add_filter( ‘posts_orderby’, ‘wpse155827_posts_orderby_price’ ); $theQuery = new WP_Query( array( ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘price’, ‘order’ => ‘ASC’, ‘suppress_filters’ => false, ) ); remove_filter( ‘posts_orderby’, ‘wpse155827_posts_orderby_price’ );