making a search.php query

You are missing the search parameter in your arguments. The code below, when added to the array in $the_query, should pass along the query string variable from a search: ‘s’ => $s Documentation is available here: https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter

Force ‘permanent’ post cache of shortcode results

You’d want to look up transients Here’s a simple example of how you do it. function showPosts (){ $posts = get_transient (“my_rss_transient”); If (!$posts){$posts=getPosts ();} /* do showing off stuff here */ } function getPosts (){ $posts = /* get posts here*/ Set_transient (“my_rss_transient”, $posts, MONTH_IN_SECONDS); return $posts } The transient should be saved for … Read more

The most recent post of custom taxonomy

Because your posts_per_page has a value of -1 means return all matching query. You should update your post_per_page to 1 and specify the order, and orderby parameters. Order the posts by date in descending order. $featured_value_cat_query = new WP_Query( array ( ‘post_type’ => ‘values’, ‘posts_per_page’ => 1, ‘orderby’ => ‘date’, // ‘order’ => ‘DESC’ … … Read more

Include images from pages in wp search.php results in default wp search

To include the attachment (media) post type in search results, use the following code snippet function attachment_search( $query ) { if ( $query->is_search ) { $query->set( ‘post_type’, array( ‘post’, ‘attachment’ ) ); $query->set( ‘post_status’, array( ‘publish’, ‘inherit’ ) ); } return $query; } add_filter( ‘pre_get_posts’, ‘attachment_search’ ); Source However, this does not take care of … Read more

Metabox – Displaying the Value of a Metabox

After reviewing your code there are a couple of things you need to change depending on where the meta content is being held. Try this to get the value $desc = get_post_meta( get_the_ID(), ‘meta_desc’, TRUE ); echo $desc; That Will be give you the appropriate meta.