Display posts with tag that matches current post title

The query would look something like this: $title_tagged_posts_query = new WP_Query( array( ‘tag’ => strtolower( get_the_title() ) ) ); while ( $title_tagged_posts_query->have_posts() ) : $title_tagged_posts_query->the_post(); //Output whatever you want here. endwhile; This assumes that the tag slug for “Hippo” is “hippo”, which should normally be the case.

Query Custom posts of same taxonomy as the post itself

Assuming you want it for all the terms in the ‘Genre’ taxonomy. In the loop on the single Service post page, put this code: <?php $the_terms = get_the_terms( get_the_ID, ‘genre’ ); if(isset($the_terms) && !empty($the_terms)){ foreach($the_terms as $the_term){ $the_terms_slugs[] = $the_term->slug; } } $works = get_posts(array( ‘post_type’ => ‘works’, ‘posts_per_page’ => 5, ‘tax_query’ => array(array( ‘taxonomy’ … Read more

Logged in user ID as post ID

You can get information on the currently logged in user using the get_currentuserinfo() function. For example: <?php global $current_user; get_currentuserinfo(); $username = $current_user->user_login; $user_id = $current_user->ID; ?> You can then use $username or $user_id in your custom loop. <?php // assign the variable as current category $category = $user_id; // concatenate the query $args=”cat=” . … Read more

Show 1 post and after a specific date show the next one

Assuming, as per the above comment, the format of the dates is YYYY/MM/DD: $args = array( ‘posts_per_page’ => 1, ‘cat’ => 6, ‘meta_key’ => ‘begin_date’, // adjust to actual key ‘meta_value’ => date( ‘Y/m/d’ ), ‘meta_compare’ => ‘>=’, ‘order’ => ‘ASC’, ‘orderby’ => ‘meta_value’ ); $wpse72195_query = new WP_Query( $args ); // do something with … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)