Linked Questions

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'=> ...
2
votes
1answer
126 views

Can ordering post list by meta_value cause performance issue?

For some code refinement and to add new features to my plugin, I want to display posts ordered by specific meta column value like this; query_posts($query_string . ...
2
votes
2answers
521 views

How to generate a list of posts published on current day?

I want to create a page labeled "Today's News" which displays a simple bulleted list of all posts published on the current day and grab the current date based on the server's date/time. Is this ...
2
votes
3answers
1k views

Adding “latest from the blog” to the homepage

I have a big problem and no clue how to solve it :) I want to add a "module" to my homepage (static homepage, not blog posts) that will display the 2 latest blog posts in a very particular way and ...
2
votes
1answer
709 views

How to dynamically build a multiple taxonomy query loop within a post type's single loop?

This question is a little different then the others floating around here. The most similar one is "How to get the parent's taxonomy ?". I have a music cms setup that utilizes two post types: album ...
1
vote
2answers
128 views

Why is the first query affecting the second query, even after wp_reset_query() and wp_reset_postdata(), but not on the second page?

I am literally clueless as to why the code does not function properly on the first page, but functions as expected on the second page. I have already tried running the second query via another ...
1
vote
2answers
29 views

All posts are still shown when adding category argument to query

I've got the following code in my team-type.php file which I'm using to create a custom taxonomy for a member information: function create_team_taxonomies() { $labels = array( 'name' ...
1
vote
3answers
170 views

Single page theme

I am trying to create single page theme. What i have trouble with is understanding this whole wordpress query logic. There is query object and supposedly i get all published posts like this: ...
1
vote
2answers
2k views

Query for multiple post types does not work

I'd like my frontpage to display a list of my lastest blog posts merged with my latest "Products" custom post type posts. From the documentation i gather this should work: query_posts( ...
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
3answers
219 views

Force index.php have_posts() loop to exit if no sticky posts found

I'm currently using the code below to list sticky posts on my index.php. However, when no sticky posts are present, its loading the latest posts (up to the number specified in "settings > reading > ...
1
vote
2answers
492 views

Query to return maximum of one post per author

We are introducing a "featured author" area on our site and would like to display the most recent articles by a select group of authors. However, we only want a maximum of one post per author to ...
1
vote
1answer
776 views

Exclude custom taxonomy tag from loop

I have the following code at the beginning of a loop: <?php query_posts('showposts=3&cat=84'); ?> <?php $posts = get_posts('category=84&numberposts=3&offset=0'); foreach ($posts ...
1
vote
1answer
89 views

Some doubts about how the main query and the custom query works in this custom theme?

I am pretty new in WordPress theme development and I'm not so into PHP (I came from Java and C#) and have the following situation in this custom theme As you can see in the homepage I first show a ...
1
vote
1answer
1k views

Wordpress Pagination Not Working - Always Showing First Pages Content

I am working on a website where I have a blog but I also have a custom post type to allow me to drop in some videos. I would like to use pagination so that if there are more then 9 videos displayed, ...

15 30 50 per page