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
121 views
Drop down list with posts within the “add new” page
Quick explanation :
When I add a new "Company" (custom post type), I have a drop down menu listing all the companies to choose if the one i'm creating depends from another one.
I got 3 metaboxes, the ...
0
votes
1answer
29 views
Pulling in a particular post into a single page based on the post id passed into the code
I currently have a page on a site that I am developing and that contains a loop which loops through 4 posts contained in a custom post type called Treatments. ...
0
votes
1answer
130 views
Upcoming Event: How do I sort database by custom date field, but ignore past dates?
I am using an events plugin and struggling to get my database query to be perfect. The query is on the event-single.php template. What I need the query to do:
Query the "events" custom post type ...
0
votes
1answer
122 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
84 views
Foreach displaying all posts and not the value set in WP back end
Pagination just isn't working correctly with my foreach code. I have to manually set the post per page count for it to work but I'd like it to use the WP back end value (Set in settings > reading) ...
0
votes
1answer
76 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 ...
1
vote
1answer
75 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 ...
1
vote
1answer
157 views
How to add tags (custom taxonomy) to post class css?
I am trying to figure out how to add my custom taxonomy for tags to the post class css when I already have added the custom taxonomy for categories. The code Im currently using to add the category ...
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
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
0answers
16 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. ...
0
votes
1answer
81 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
1answer
668 views
sort and display posts by custom field (wp-query and the loop))
i only want to show upcoming events posts on the homepage. i have made a custom field using the 'custom field suite' plugin, called 'ENDS' representing the date an event ends.
as you can tell, i ...
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 ...
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() ) : ...
0
votes
0answers
70 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
181 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
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
25 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
106 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
92 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
87 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
32 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
79 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
32 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 ...
4
votes
2answers
74 views
Randomise results from a category page?
I have my standard category page. On this page, I'd like to put a button which, when clicked, randomises the results shown on the category page.
I know I could make a rand-category.php page and send ...
0
votes
1answer
81 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
138 views
Display Page Meta Description on Child Theme’s Home Page
I’m working on a project. I need to display Custom Document Title & Page Meta Description in the home page. I mean you know that genesis has a custom Theme SEO Box under Post. I want that custom ...
0
votes
2answers
305 views
How to modify the Loop from a plugin (instead of a theme)
I am building a plugin which sets up a custom post type with some meta information.
I'd like that information to show up in the loop (in particular the one on the main page).
How can I modify the ...
0
votes
1answer
24 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?
...
1
vote
1answer
61 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
38 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
114 views
Chaining Taxonomy Queries
I have a quick question.
Could someone show me how to make a loop that does the following.
Query all posts for one tax (Meal Time: eg. Lunch, dinner, dessert...)
then
Loop each taxonomy ...
1
vote
2answers
78 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 ...
0
votes
1answer
100 views
Sort by category and then date?
I'll try to be as clear as possible. My Wordpress site has multiple custom categories and posts types all which need to be displayed on the home page blogroll. But I need the first post on the ...
-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
56 views
Using Query In Post Type Archives
I'm using the script below to call post from a certain category in the sidebar. It pulls from all post type on the homepage and on the single post page, but when it comes down to the post type archive ...
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
2answers
951 views
How to create custom query by keyword in post title?
I need some help regarding Custom Query by keyword.
I send a keyword to my page where I would like to list those posts which post_title contains the keyword I sent.
Here comes my query as follows:
...
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 ...
-1
votes
1answer
119 views
Limit wordpress posts loop to continue onto another page
Theres a site i did that on the home page, i created kind of like a news box type
of thing which is what the client wanted...
the posts bit im using to limit the posts on the index page is
...
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?

