Linked Questions

1
vote
2answers
1k views

Custom posts per page does not work with pagination

I have one page in my template where I would like to set a custom posts_per_page. Here is the code I have used: <?php global $query_string; query_posts($query_string . '&posts_per_page=4'); ...
2
votes
1answer
1k views

Is it necessary to reset the query after using get_posts()?

Is it necessary to reset the query after using get_posts() ? I have been looking at this page and I don't see any reference to get_posts() ... I can't make it out for sure from this page either. I ...
3
votes
1answer
2k views

WP_Query vs get_posts

I have read a number of questions on SE regarding these but I still can't figure the exact difference wrt usage. Would it be true to say that I would probably use WP_Query for the majority of ...
0
votes
1answer
492 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
3answers
707 views

Split wordpress loop to multiple layouts

OK so I've searched a lot and couldn't find a straight forward answer to my question. I am simply trying to use one category loop that will display posts in a category page in a wordpress site. lets ...
0
votes
2answers
380 views

How to order different custom post type in category or tag template page?

I have 3 differents custom post type : "Projet", "Notice" and "Disque". I want them to appear in a specific order when they are listed in the category or the tag template page. Like that : 1 - ...
0
votes
1answer
85 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 ...
1
vote
4answers
3k views

Wordpress not respecting template hierarchy (fetches index.php instead of single.php or page.php)

I've encountered a strange error while developing a custom theme. After finishing editing the template for a custom post type single view, I passed onto working at the template files for pages and I ...
1
vote
2answers
490 views

sticky post in custom loop

I have a problem with showing sticky posts in a custom loop. This is the code I'm using to for the custom loop: <?php $post_from_cat_a = new WP_Query(array( 'category_name' => ...
1
vote
0answers
196 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 ...
2
votes
1answer
161 views

reference the current category being used in the category.php page

I have this code in my category.php file <?php query_posts( array('post_type'=>'featured' )); $featured = new WP_Query( array('posts_per_page'=>1, 'tax_query'=> ...
7
votes
2answers
2k views

Looking for WordPress System Diagrams

I am looking for WordPress chart/diagram system design. I found only the template hierarchy diagram, but it's only part of the system. source: ...
0
votes
1answer
211 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
2answers
303 views

Disable (or limit) queries when certain content (or data) is not needed (or showed)

Currently I am making a custom design for a site. The problem I'm seeing in Wordpress is about almost all data pulled out from the database. While in certain pages - like front-page.php - it only ...

15 30 50 per page