Starting with an example makes more sense, so here’s an example function: function seo_meta_tags() { global $post; if( is_singular() ) { setup_postdata( $post ); $description = str_replace( '... <a...
How would I be able to insert data into the post meta table? I know how querying and wpdb works but I have no idea how I can just...
I have a pretty standard loop which outputs “Sorry, No Posts Found” when a search result comes up empty. if ( have_posts() ) : while ( have_posts() ) :...
I’m unclear on the get_the_foo() style of functions, for example get_the_permalink(). My main question is: when this is performed in The Loop, is another SQL query executed (besides the...
I’m trying to obtain all orders for particular day/time and then order products using SQL (MySQL) as seen in the query below: select p.ID as order_id, p.post_date, i.order_item_name, max(...
I am trying to change all images links from http to https, is it possible doing that on a batch query working on the whole database? How? Moreover my...
I’m trying to intercept the search query before it’s executed in WordPress. I’ve tried a bunch of things but it’s just not working. So, for example, a user enters...
If I have a user’s ID, what’s the best way for me to get the title of that user’s most recent post? 2 Answers 2 You just set the...
How can I modify my query in order to exclude certain posts by slug? Is it possible? query_posts(array('category_name' => 'Mycat', 'posts_per_page' => -1)); Ty 2 Answers 2 You can...
I know I can use get_num_queries() for the number of queries. However, how can I see what queries WordPress actually makes? I’ve tried using $query but that didn’t work....