Linked Questions

-1
votes
1answer
210 views

Sticky post for all pages and categories

I want to have a sticky post for all my pages and categories. The choice of "sticky post" in the edit post, didn't work. I found many pieces of code but I haven't the result that I want. I prefer to ...
1
vote
0answers
198 views

Custom post type pagination - always return first page

I have custom post template archive-product.php for custom post type "product". In this template paging does not work: numbers are displayed all numbers links redirect to first page ...
0
votes
0answers
46 views

Why doesn't my WordPress page show the most recent post?

I was wondering if someone could help me with the following. My news page on my WordPress website doesn't show the most recent blog post, which I want it to do. The code I have is: ...
0
votes
0answers
31 views

Remove duplicates from foreach

I'm trying to loop through a custom post type and display all meta values for a meta key. I'm able to display all the values, however there are some duplicates. I want to remove those duplicates. I ...
0
votes
0answers
11 views

query_posts, and filter with a meta_key that is an array [duplicate]

Inside one of my custom post types, I have a custom field that gets its values from another custom post type, and show them in a dropdown menu, something that's called a Relation Custom Field in PODS. ...
0
votes
0answers
75 views

Pagination working locally but not on live site

I have a loop on my single.php page like this:- <?php if (have_posts()) : ?> <?php $paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1; ?> <?php $this_post = ...
0
votes
0answers
15 views

Looping through a custom query makes WordPress assume another template [duplicate]

I am calling this code from my custom sidebar, in order to get related postings from the same category: query_posts(array( 'cat' => get_category_id(), 'showposts' => 5, 'post__not_in' ...
0
votes
0answers
40 views

Query_posts using two custom taxonomies not returning posts

If I remove 'relation' and one of the taxonomy arrays the corresponding posts are returned for each taxonomy but when I add the 'relation' = 'AND' no posts are returned. Is there a problem in my ...
0
votes
0answers
27 views

Secondary loop cuts off at 10 posts?

I have a loop to get a tag name from the URL slug, and then show all the posts, grouped by category, that matched that tag. It works, but I recently noticed it only shows 10 posts despite my setting ...
0
votes
0answers
34 views

Global post is always custom post type last post

my global $post is always taking the object of my custom post type "advertisement". So when i'm editing e.g. "Hello world" which post id is 1, it shows me post id of the last advertisement post. If ...
0
votes
0answers
15 views

Display last posts with comments link on static page

I want to create a static page which will be almost the same as the default one with latest posts. I know I can use query_posts( 'posts_per_page=5' ) to display my last five posts, but the comment ...
0
votes
0answers
51 views

Query posts dynamic date range

So, I'm using the following to filter posts: $paged = is_front_page() ? get_query_var( 'page' ) : get_query_var( 'paged' ); $args['paged'] = $paged; ...
0
votes
0answers
24 views

Sort By Custom Field - Strange Problem

I have a site where I'm posting some of the post at Features with a meta key name "Listing Type" and meta value "Featured". Now the problem is when I use: query_posts($query_string . ...
0
votes
0answers
135 views

Complex WP_Query Using Post Date And Post Meta

I am using Wordpress as a CMS on a website which has standard posts, a custom advert post type and a custom event post type. The event post type has some custom meta which stores the event start date. ...
0
votes
0answers
190 views

The offset option breaks the pagination

I have a problem with a website of mine, I was hoping you can help me. I added the offset option to ignore the first couple of posts in the main loop. It does its job, but the navigation got broken. ...

15 30 50 per page