The core of the WordPress query, the loop offers an easy way to access post information and display it on your website.
0
votes
1answer
74 views
2 loops in blog homepage
I would like to have to query loops running on my blog homepage:
Featured posts on top displaying 3 posts from the category : "Featured"
Underneath it just the basic loop of wordpress which display ...
0
votes
0answers
6 views
Displaying featured posts along with regular posts [duplicate]
in my homepage blog, I am trying to display 3 "Featured" posts on top and the rest of the posts at the bottom which means:
The 3 "Featured posts" are taken from a "Featured" category
underneath it ...
0
votes
1answer
120 views
post__not_in not working for custom post type [closed]
I cannot get the 'post__not_in' parameter to work properly in my theme. I have a custom post type 'event'. I'm in this theme file: single-event.php
<?php $args = array(
'post__not_in' => ...
0
votes
0answers
15 views
How to sort through and display several CPTs on a single page
I built this site http://sparkfitnessbootcamp.com/ However, everything has been hard coded and is very difficult for the users to manage. So I want to create CPTs to make everybody's life easier. ...
1
vote
1answer
72 views
Pagination go to first page if i'm on last post
I have a custom post type and used get_next_post() and get_previous_post() to create a simple pagination. However i need to create a pagination loop (if that is the correct term). If i'm on the first ...
0
votes
1answer
38 views
Order custom posts by taxonomy?
I have the following custom post types:
books, documents, examples, guidebooks, onlineaids.
They were generated by the following code:
...
0
votes
1answer
79 views
wordpress change the loop order by dynamic value
At the moment i have a custom field named "price" to order my posts correctly.
The following already works:
$query_args['meta_key'] = 'price';
$query_args['orderby'] = 'meta_value_num';
...
0
votes
2answers
243 views
Custom Post Type on Homepage - Studiopress Genesis Framework
I have used to below function to register a new 'guide' content type:
add_action( 'init', 'guide_post_type' );
function guide_post_type() {
register_post_type('guides',
array(
'label' ...
0
votes
0answers
68 views
How to display custom post types by custom taxonomy in while loop?
I am using Posts 2 Posts to display a custom post type on a page.
Document status, document author and feedback due date are custom fields.
Package is a custom taxonomy.
I want to display my custom ...
0
votes
1answer
62 views
Adding a featured image to a foreach Wordpress loop
I just found a clever piece of code on line which allows Wordpress posts to be displayed in side by side columns and works great with the title and post excerpt that I want to display.
However I ...
0
votes
1answer
17 views
using the loop on a page
I'm trying to display the excerpt of the most recent post and just the titles of the 4 previous posts before that at the top of a page and display the content of the page below. I have a solution ...
0
votes
0answers
24 views
Including author posts and custom post types in the same loop
I have an author page with a special template I built for my purposes
it's of course called: author.php
it basically display some details about the author and his (or hers)
latest posts.
the problem ...
0
votes
2answers
101 views
the_title() shows title of the first post instead of the page title?
I'm occasionally facing this problem and not sure what causes it, any ideas?
<?php get_header(); ?>
<div class="content" role="main">
<h1><?php the_title(); ...
0
votes
0answers
49 views
Archive page - display specific post first
This is something I haven't heard of before but must be fairly easy to do?
In the archive.php file, Given the id of a certain post (probably passed as a variable through the url) I want to know how I ...
0
votes
1answer
176 views
Permalinks for single-[custom-post-types] not working
I've been reading a lot about my simple issue, but wasn't able to find the simple answer, so, please excuse my noobieness.
I have a custom post type registered in functions.php, like so:
<?php
...
0
votes
1answer
87 views
How to use WP_Query() on single.php?
I'm using WP_Query() to pull out a few posts under a specific category "Featured" to display at the bottom of any post.
So I added <?php if (function_exists('getEditorPicks')) ...
0
votes
0answers
39 views
WP_Query returns 100 results on homepage
Bit of a strange one this...
I've recently migrated a site from wordpress.com to my own server. In the new location, however, wp_query always returns 100 posts on the homepage, regardless of which ...
0
votes
1answer
82 views
Loop through Custom Post Type, and then show children within each iteration
I am currently using WP_Query to loop through a custom post type, and only showing the parent posts like so:
<?php $loop = new WP_Query( array( 'post_type' => 'programs', 'posts_per_page' => ...
0
votes
0answers
30 views
Price list, query/loop within query/loop
Price list, query/loop within query/loop.
Hi all
I'm developing a theme for a cafe.
The page structure is something similar to
Home
|
Menu
|
Starters - starter_1 - ...
0
votes
2answers
76 views
Contact information footer
I am new to Wordpress but forced to create a website as a Wordpress template for my current employee (I am a front end developer, mostly build new systems/apps etc from scratch). Creating the template ...
0
votes
1answer
81 views
If Loop has odd number of posts on last page Custom style for last post in it
My loop displays posts in two columns using this php
<?php
if (have_posts()): while (have_posts()) : the_post();
$count++;
?>
<?php if ($count == 1) : ?>
<div ...
0
votes
1answer
31 views
Noob Loop Question
I come with a basic question but I can not solve, I think that will be easy for you. I would like, if I have 2 or more post on loop, show the entire loop. I tried the following:
<?php
$paged = ...
0
votes
0answers
33 views
Retrieving Categories of posts which have a custom Taxonomy
I am working on an event management WordPress site which has multiple taxonomies (Photographer, Event Manager, Decor, etc).
I want to create Taxonomy pages for each of these taxonomy (this is the ...
0
votes
1answer
80 views
Categories and page filtering with pre_get_posts
I have 3 pages, "Page 1" shows custom post-type "articles", "Page 2" shows custom post-type "tips", and "Page 3" shows both custom post-types. This is done conditionally with a custom loop in ...
0
votes
1answer
32 views
Loop not showing up on page template
I have a page template and on the page I have a loop such as:
query_posts('post_type=post&posts_per_page=5&paged='.get_query_var('paged'));
if(have_posts()){
while(have_posts()){
...
0
votes
1answer
23 views
new custom theme - posts displaying on top of one another
live blog
I've just implemented a new, custom theme. I've noticed that my posts are now displaying all on top of one another and I can't figure out why. To test my code, I swapped out my custom loop ...
0
votes
2answers
51 views
older blog posts not showing in new theme
I have a new, custom theme that I've uploaded on a pre-existing site/blog. Everything seems to be working ok, with the exception of the older blog posts not showing up. Any ideas what I can do to fix?
...
6
votes
1answer
111 views
Why am I being limited to ten posts on a custom loop?
For example, I have a link on my site like /tag/green and select content from all posts tagged green are shown using a file loop-tag.php which is about as simple as
<?php
if ( have_posts() ) : ...
1
vote
1answer
60 views
Get search.php results in header.php?
I want one image in header.php to change for different pages.
The function in header.php looks like that:
if(is_archive()):
//change image to "Archives"
endif;
if(is_404()):
//change image to ...
0
votes
1answer
44 views
Filter Category Loop Dynamically
I'm trying to display a custom loop with a dynamic category filter.
As a setup I have categories of all usernames which are created once a user creates an account.
So I am trying to echo the user's ...
0
votes
1answer
37 views
How to order posts in an arbitrary order?
I need to list posts in a very specific order that has nothing to do with the date of the posts or the title, or anything WordPress can figure out for me. I need this order to be used when I list ...
0
votes
1answer
37 views
Remove the_content From Loop
I'm trying to display a custom loop with only certain elements in it.
My loop currently contains the title, creation date, author & content.
However I am trying to remove the content for each ...
0
votes
1answer
239 views
WPML wp_query not working properly in one language
I have a wp_query for a custom post type and the custom taxonomy, the idea is top display the term name and below each term the associated posts. I have two languages Dutch & French. Query is ...
1
vote
2answers
76 views
Child_of not displaying all children posts.. via get_posts
I have put together this loop to display all children posts of the desired cat, but i am not getting any of the posts from one of the children cats..
Not sure if i am using the best method to ...
5
votes
3answers
269 views
Get 'page' number with infinite scroll
I added infinite scroll support of the Jetpack plugin to my own theme using this tutorial:
add_theme_support( 'infinite-scroll', array(
'container' => 'content',
'footer' => false,
...
-1
votes
1answer
37 views
Get Posts From A Certain Post Type In An ID Array
I have some post ids in an ID array, like:
$ids = array(20,34,65,126) ;
There is many custom post types in my project, these ids are related to different post types, but I dont know which id is ...
0
votes
1answer
64 views
Display multiple custom post type lists on homepage - multiple loops
I've got to display 6 boxes on the homepage of a site I'm working on and struggling with the code. I've managed to get this far:
<?php
$term = get_term( hotelCategoryID, 'accommodation-category' ...
0
votes
1answer
22 views
Custom Post type showing up in loop, regular posts are not showing up
Every one knows the basic WordPress loop, every one knows that if you want just posts in a loop you put query_posts("post_type=post"); BEFORE the loop. which I have done.
The problem is I have a ...
0
votes
1answer
29 views
New loop vs widget
So, I have a sidebar that I'm going to list all posts in, I could just use a widget.
But is it proper to use a new loop instead of a widget, or preferential?
2
votes
1answer
17 views
Output shows a page instead of a list of blog postings
I have the below code in front-page.php (with that page set in Settings > Reading); however, something is wrong because the posts aren't showing. The output is shown below. Can someone identify what ...
1
vote
1answer
205 views
query_posts() vs get_posts() multiple loops [duplicate]
I have a template which initially had one single loop and it was using query_posts, I added 2 more loops using the same method, However after reading allot about these it was concluded that I shall ...
0
votes
1answer
41 views
WP_Query: query posts by ids from array?
I did quite a bit of research but can't figure why this wouldn't work for me?
echo print_r($rel); // Array ( [0] => 63 [1] => 87 )
$args = array(
'post_type' => array( 'post' ),
...
1
vote
1answer
35 views
Create a loop that gets pages with their template
I am trying to make a template that will be an html5/ vertical scrolling base.
I have created an amount of page templates that each would represent a <section> on index.php which mainly all it ...
0
votes
1answer
56 views
Modifying a Loop to Show More
This loop shows one featured post above 4 post titles from a certain category that is specified in the theme options.
What I would like to do is show all 4 posts from the 4 titles, above the 4 ...
0
votes
1answer
172 views
Pagination on category.php and tag.php not working
i'm using a query-loop on my template pages like this:
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$wp_query = new WP_Query();
...
2
votes
3answers
77 views
wordpress loop and template files
I am curious how WordPress know that if I have a category.php and do the basic loop inside there that when I click on category A I get all of A's posts. The reason I ask, is because I have seen themes ...
2
votes
2answers
77 views
Do I need to use The Loop on pages?
I'm writing my first WordPress theme and have a question about the use of The Loop in page templates. The page templates I've looked at all follow basically the same pattern (example from Twenty ...
0
votes
3answers
43 views
Trying to display ads on only a third of posts in a loop. Keep getting Error 500?
I'm thinking it's just a PHP code error, but for some reason the following code won't work, it just keeps giving me Internal Server Error 500
<?php
$ajfl_adLuck = rand(1,3);
if ($ajfl_adLuck ...
1
vote
2answers
65 views
Query reset problem or flawed code to enable custom post type query
After reading through here and trying various options, I am finally able to get my custom post types 'testimonial' (created with product 'Toolset') to show along with my standard cat/tag queries ...
0
votes
1answer
27 views
Hook to main query with filters based on custom fields
I would like to do a filter that will hook to the main query and filter all the posts by some given taxonomy terms or custom fields. For now I have made the custom filters for the $query to only ...

