Custom pagination (Title, date and teaser)

I assume you’re talking about single posts, not archives – get_next_posts_link gets the next archive page, get_next_post_link gets the post next to the current one (note the plural difference). If so, the next/previous post link functions are just wrappers for get_adjacent_post(): <?php if ( $the_query->max_num_pages > 1 ) : ?> <nav class=”prev-next-posts”> <?php if ( … Read more

Query All Attachments and Order by Parent Publish Date

After spending some time reading the documentation for WP_Query’s Order & Orderby Parameters I found the following listed parameter to almost get me there: ‘post__in’ – Preserve post ID order given in the post__in array (available since Version 3.5). Unfortunately I wasn’t using post__in but rather post_parent__in so ordering by post__in didn’t work. It wasn’t … Read more

how to exclude store in clipper theme wordpress code php

Put your category id’s in an array format. Like the below one. $cat_related = query_posts( array( ‘post_type’ => APP_POST_TYPE, ‘post_status’ => ‘publish’, APP_TAX_CAT => $string_array, ‘ignore_sticky_posts’ => 1, ‘paged’ => $paged, ‘post__not_in’ => array($post->ID), ‘category__not_in’ => array ( $store_id )// this is STORE ID ) );

Problems with WP_Query, Loop, a condition and Posts per Page

Just for your Info. I switched my Plugin to Advanced Custom Fields and created the Query like this. Maybe it was because of the “-” I used in my CustomField or it was the format of my Date. $today = date(‘Ymd’); $args=array( ‘post_type’ => ‘veranstaltungen’, ‘posts_per_page’ => 3, ‘meta_query’ => array( array( ‘key’ => ‘ende’, … Read more

meta_query not working with the_content()

the_content() echoes data to the page so essentially your query looks like: ‘meta_query’ => array( array( ‘key’ => ”, ‘value’ => $related_venue_variable, ‘compare’ => ‘==’ ) ) You want get_the_content() to return a string that you can pass along through the query. However, having the post content as a meta key doesn’t make any sense. … Read more