Can we return all category (not post) with Custom Query Filter? [closed]
Can we return all category (not post) with Custom Query Filter? [closed]
Can we return all category (not post) with Custom Query Filter? [closed]
Meta_query on same meta key, with diffrenct values
meta_query BETWEEN, but the range is stored in the custom field
You need to simply pass your current page with your ajax request. Put this property on your “body” tag to be able to get this with JS in the future. <body page-id=”<?php get_the_ID(); ?>”> Find it in your JS var page_id = $(‘body’).attr(“page-id”) Pass it along with your other “data”: var data = { action … Read more
You can hook into the rest api query and add your args from url’s parameters The code will look something like: function query_post_by_fields($args, $request) { $url_params = $request->get_param; //Modify $args with your url params return $args; } add_filter(‘rest_post_query’, ‘query_post_by_fields’, 10, 2); Docs: https://developer.wordpress.org/reference/hooks/rest_this-post_type_query/
You might be able to use the the_author_posts_link filter to do this: add_filter( ‘the_author_posts_link’, functoin ($link) { global $post_id; // get “source” tax terms $sources = get_the_terms( $post_id, ‘source’ ); // build html $html=””; foreach ($sources as $source) { $html += ‘<a href=”‘. get_term_link($source) .'”>’. $source->name .'</a>’; } // pre-pend html to author link $link … Read more
Is it a good idea to improve meta query performance by adding tax query?
I manually added a “featured” meta key to 2 different posts with values of 1474 and 2213 and then ran a basic WP_Query() like so: $qv = [ ‘meta_query’ =>[ [ ‘key’ => ‘featured’, ‘value’ => [1474, 2213], ‘compare’ => ‘IN’, ] ] ]; $r = new WP_Query($qv); It pulled up both posts. This was … Read more
How to query post only with different excerpt?
I got it to work by using the following code function get_gas_options($a) { $args = array( ‘post_type’ => ‘fleet’, ‘orderby’ => ‘ID’, ‘post_status’ => ‘publish’, ‘order’ => ‘ASC’, ‘posts_per_page’ => -1 // this will retrive all the post that is published ); $result = new WP_Query( $args ); $title_list[”] = “Assign a Vehicle”; if ( … Read more