Linked Questions

0
votes
1answer
212 views

'category__and' for custom taxonomy?

I've a custom post type 'post-type-x' and three custom taxonomies attached with it 'taxonomy-1', 'taxonomy-2' and 'taxonomy-3'. I want to retrieve all the posts that have custom taxonomies ...
0
votes
1answer
162 views

Filter posts by specific custom category and current tag

I have set up a custom post type (buyers_club) with a custom category (buyers-club) and custom tags (country). I'd like to show a list of related posts by specific category, FEATURED, and by the ...
0
votes
1answer
39 views

I would like to feature a tip on the homepage

I'm sorry if this question is explained somewhere, I couldn't find it. But it's also difficult to express this special thing in a second language.. I have a very simple homepage, and on that homepage ...
0
votes
1answer
527 views

WordPress custom post type category pagination 404 Error

This problem is giving me a headache and I was wondering if anyone knew how to fix it. I have a custom post type called Review. Here is how it is defined: function codex_custom_init() { $args ...
0
votes
1answer
174 views

Ordering Subcategories

I'm using the following code to display data from subcategories. The subcategories are 'United kingdom', 'England Only', 'Northern Ireland Only', 'Scotland Only', 'Wales Only'. Ordering by date or ...
0
votes
1answer
39 views

How to have more post in a page than in your home page

I am new to the world of WordPress. I own a new site and I'd like my home page to display the latest news and articles (which I accomplished to set in Settings > Reading), but I'd like another page to ...
0
votes
1answer
26 views

Why is my pagination showing up?

I have the following code, Assume this code spits back one post. the page displaying that post will also display pagination. Why? It shouldn't. This code only queries for posts that belong to the post ...
0
votes
1answer
64 views

Post content stays the same but permalink changes ?

This is really weird. I made a posttype ' mediagallery ' via the plugin Types fields. I simply want to load the post content and switch the posts with a next & prev button in de sidebar. The post ...
0
votes
1answer
25 views

wordpress taxonomy results

I am using taxonomy.php to fetch some rows from database. On taxonomy page the function get_queried_object() shows that I have got the right results from database but wordpress loop if ( have_posts() ...
0
votes
1answer
3k views

How to create a category and sub-category sorted blogroll with all posts?

I would like some help to post all the posts of my website into a blogroll sorted by categories and subcategories. The end-result HTML I would like to see displayed would be something like this: ...
0
votes
1answer
220 views

Order posts of a custom post type by the event date using FT Calendar Plugin

I am using the FT Calendar Plugin. My question is how can I order posts of a custom post type by the event calendar date? So for instance I have a CPT named "Events" and for each event post a ...
0
votes
1answer
169 views

Restrict query_posts by Date?

To display the most popular posts based on page views I am using this code (source): <?php query_posts('meta_key=post_views_count&orderby=meta_value_num&order=DESC'); if ...
0
votes
1answer
81 views

Display posts from a category

I am trying to display a bunch of posts from a single category on the category page, using multiple loops. <div id="featured-content" class="clearfix"> <? // assign the variable as current ...
0
votes
1answer
86 views

Exclude current sticky post

I have the following query, trying to fetch the latest sticky posts but exclude the current one: $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice($sticky, 0, 3); ...
0
votes
1answer
104 views

Why does this query not SELECT post IDs like a normal query would?

I have a page template, call it page-myblog.php, that I want to display an ordinary loop on. I have created a page 'myblog' in the admin area and it crops up as normal on the front end. I want to ...
0
votes
1answer
465 views

pagination does not work with query_posts. Help! [duplicate]

I made ​​a separate page template (added sidebar), this page contains all the posts. Pagination works! But, if this page set as the home page, pagination is not working! Please help find solutions ...
0
votes
1answer
364 views

Archive page showing wrong month

My site's archive page is echoing wrong Month name. Though the URL is 2012/11/, it's echoing the month December 2012. I found nothing wrong with the code: <?php if ( is_day() ) : printf( __( ...
0
votes
1answer
1k views

How do I make archives.php for one category only?

I have a basic archives.php file. I was trying to get it to display only posts from category 1. When I do query_posts('cat=1'), the URL is then ignored and all posts in category 1 are displayed. For ...
0
votes
1answer
682 views

A two column loop with one lead post

I got a loop from internet (I forgot the site) for two column post view. It has a nice CSS for it too. But skipping that for the question now. <?php $counter = 1; ?> <?php ...
0
votes
1answer
489 views

get_posts() and global variables

I was reading this post: When should you use WP_Query vs query_posts() vs get_posts()?, which seems to have become the go-to post for understanding the difference between the different functions for ...
0
votes
1answer
119 views

Wordpress pagination URL posts not load

I set up wordpress newly and add next previous pagination in home page using following code next_posts_link('Older Entries »', 0); previous_posts_link('« Newer Entries', 0); Pagination URL work ...
0
votes
1answer
469 views

Pagination not working in category listing [duplicate]

I can't get pagination inside categories listings to work. I'm using a custom query, with the get_query_var('paged'): $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args=array( ...
0
votes
1answer
82 views

If Query Post Returns 1 Post

I have been using Query Post for a newsticker which I have created so that the user navigate through the number of news by simply pressing Next & Previous buttons. But in case if there is only 1 ...
0
votes
1answer
202 views

templates with page teasers Or Featured Items

I've been given a design for a WordPress site which will be mostly made up of pages rather than posts. However, at the top of each page there needs to be three featured items in a row. Each featured ...
0
votes
1answer
54 views

Radom post image/link based on custom taxonomy

How would I make a widget to display a random post's image and permalink? I would like it to pull from a specific custom content type and only posts have set the custom field of "featured" to "yes".
0
votes
1answer
334 views

Tag template not returning posts [closed]

I have the following code which SHOULD print out the title of all posts with the associated tag (in this case the tag is 'icon'): <?php $tagname = get_query_var('tag'); ?> <?php ...
0
votes
1answer
2k views

When to use Wordpress loop or Foreach loop?

Under what circumstances would you, (should you?) use a foreach loop, instead of the wordpress loop. I have no real coding need, but I'm curious. What's good practice here? Should I: ...
0
votes
1answer
312 views

2 loops, is_home won't work, count is off

Alright, I've made a bunch of themes over the years, and I've written a lot of queries. And I just realized that I apparently have no clue how to get multiple queries to behave. So, here is the loops ...
0
votes
1answer
84 views

Page view: Sorted by categories

I think this might be a really simple problem, but I just don't know exactly what and where to enter the specific code and before I mess up, I thought it's better to ask for help here. I was able to ...
0
votes
1answer
3k views

Sub-loop / nested loops Best Practices

I'm trying sort through the morass that is WP documentation, and just need someone to clear up the use of the term "The Loop" and how it relates to subloops. My understanding of "The Loop" is that ...
0
votes
1answer
104 views

Pre-existing arguments when using queries

I am struggling to understand how queries work with get_posts(), query_posts() and WP_Query(). In particular I do not understand what pre-existing selection may exist when using these on a given page ...
0
votes
1answer
656 views

Custom Post Type Query for Sidebar Doesn't Work on Front Page

Interesting issue here. I have this: $args=array( 'meta_key'=>'_simple_fields_fieldGroupID_1_fieldID_8_numInSet_0', 'post_type' => 'stores', 'post_status' => 'publish', ...
0
votes
1answer
292 views

Custom page template, not acting as page

I have defined several page templates on my site http://178.21.128.82/. When I set my pages to use one of these page templates, wordpress seems to stop treating it as a page: It is not accepted in ...
-1
votes
1answer
20 views

repeating posts on 2nd page to posts

I am having an issue where I wanted to strip out all categories but one from the homepage so I added the following to the loop: query_posts('cat=2'); However now the issue is that page one of the ...
-1
votes
1answer
79 views

Making current_page_item work with wp_list_pages in sidebar on post pages

I'm working on a website where we have a menu in the sidebar that pulls the list of the parent for the current page, and all the children of that page. The problem is that, on pages where there's a ...
-1
votes
1answer
38 views

query posts in wordpress

I want to filter my query results just before the_loop starts in word press. I only want the results having term_id or term_taxonomy_id equal to 1. ...
-1
votes
1answer
200 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
193 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
9 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
60 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
32 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
26 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
30 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
14 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
47 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
68 views

Adding a Blog Loop to Static Home Page

I am new to WordPress and not that familiar with coding. Could someone explain how to add a loop to my blog to the static front page? I'd like for the first 10 blog posts to be displayed under my ...
0
votes
0answers
133 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
149 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