Post Filtered by Custom Field Value

Took the advice and decided not to reinvent the wheel. Created a taxonomy specific for products called Product categories. Added the following code to my functions.php. add_action(‘init’, ‘products_categories’, 0); function products_categories(){ $labels = array (‘name’ => _x(‘Product Categories’,’taxonomy general name’), ‘singular_name’ =>_x(‘Product Category’,’taxonomy singular name’), ‘serch_items’ => __(‘Search Product Categories’), ‘popular_items’ => (‘Popular Product Categories’), … Read more

Add WordPress users to a custom post type

You can use the ACF plugin for https://wordpress.org/plugins/advanced-custom-fields/. Steps need to do: Download and installed ACF plugin. Click on Custom Fields link at the left side menu Add custom field as: Select custom as and publish it: Now add this code in functions.php file as: function acf_load_color_field_choices( $field ) { // reset choices $field[‘choices’] = … Read more

Wp Query sort order from custom MetaBox

With the guidance of @jacobPeattie below is the working example. Once I removed the commas everything was working great. I added number_format to the deal amount to automatically add the commas on the frontend. <?php $transaction = new WP_Query( array( ‘post_type’ => ‘transactions’, ‘paged’ => $paged, ‘posts_per_page’ => 50, ‘orderby’ => array( ‘meta_value_num’ => ‘ASC’ … Read more