Use WP Title instead of custom field to call

You’re passing too many arguments to urlencode. WordPress provides a couple of useful functions for these situations. add_query_arg is a helper to build a URL with query arguments, and esc_url provide sanitation and validations relevant to encoding URLs. Also, wp_title will display or return a combination of the page/post title and a seperator, which doesn’t … Read more

Query multiple meta values at the same time :

You’ll need to change your search form, PHP uses fieldname[] notation to accept multiple values for a parameter name. <input type=”checkbox” name=”modele_du_processeur[]” value=”Core i3″ /> <input type=”checkbox” name=”modele_du_processeur[]” value=”Core i5″ /> <input type=”checkbox” name=”modele_du_processeur[]” value=”Core i7″ /> Once that’s done, you will get an array in $_GET[“modele_du_processeur”], so you can work with $args = array( … Read more

Sorting post by custom fileds date

Here is the Code function university_adjust_queries( $query ) { if ( ! is_admin() && is_post_type_archive( ‘program’ ) && $query->is_main_query() ) { $query->set( ‘orderby’, ‘title’ ); $query->set( ‘order’, ‘ASC’ ); $query->set( ‘posts_per_page’, -1 ); } if ( ! is_admin() && is_post_type_archive( ‘event’ ) && $query->is_main_query() ) { $today = date( ‘Ymd’ ); $query->set( ‘meta_key’, ‘event_date’ ); … Read more

sorting in wp query based on custom field value

“’orderby’ => $company_name,” should be “’orderby’ => ‘meta_value’,“ If the value of _company_name is numeric – it should be meta_value_num. Note that ‘orderby’ can only have a predefined value and ordering does it alphabetical See the possible values at the WP_Query orderby parameter: https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters The ordering parameter says: Order alphabetical by the values of meta_key … Read more