The core of the WordPress query, the loop offers an easy way to access post information and display it on your website.

learn more… | top users | synonyms (3)

0
votes
0answers
21 views

Turn Custom Post Title into external link [duplicate]

I created a Custom Post Type called News, which supports Title, Editor, Thumbnail and Custom Fields. One of the Custom Fields is URL. What I need now is to turn the Title in a external link in the ...
0
votes
1answer
51 views

query_posts ignores the argument

The query_posts totally ignores the day argument. I'm trying this: $day = date('j'); query_posts('day='.$day); if (have_posts()): while (have_posts()): the_post(); //show posts endwhile; ...
0
votes
0answers
60 views

Sort posts by each day in the loop

I want to sort the posts in the loop by each day's posts. Since I have added filter to get posts from only last week, therefore there will not be repeating days (eg. There will be wednesday only ...
0
votes
1answer
42 views

Fallback if statement based on the number filtered from it

I'm trying to add three ads on a page. I have a custom post type called 'ads' and I'm using advanced custom fields to add a start date an end date and an option to select which pages to associate them ...
0
votes
2answers
57 views

If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?

One custom post type that i've created has 5 custom fields that display specific content for a template that displays them in different areas on the page. My question is if i would have to create ...
0
votes
0answers
232 views

Converting an existing query_posts to WP_Query

I am having trouble trying to convert my query_posts loop that is bugging out to a WP_Query, was hoping someone may have some luck looking at it: This is my old loop: <article ...
0
votes
0answers
261 views

loop through custom post types with meta data

I'm really curious as to how might be the quickest way to loop through a custom post type with meta data. I have some code that works but it's slow. I'm using wp_query and it works. I have also a ...
0
votes
1answer
137 views

Fake Single Wordpress Post (Page) Loop

In a plugin, I am building a custom page with add_action('template_redirect', function(){ include(TEMPLATEPATH."/page.php"); exit(); }); add_filter('the_title', function(){ return "Virtual ...
0
votes
1answer
330 views

why is this content-template not showing any of my blog-entries?

i'm using the blogolife-theme on wordpress 3.6.1 my template looks like this: <?php /* Template Name: Template One */ ?> <?php /** * A custom template file. * @package WPLOOK * ...
0
votes
0answers
54 views

Show post when both categories are present but not one of them

I'm having issue filtering posts by category. There is the A category for posts (which is the default and also applies when no category has been set explicitly) and B category with subcategories for ...
0
votes
1answer
2k views

How to place comments_template(); outside the loop?

I am making a new template and I need to place the comments template outside the wordpress loop and just above the footer in the single.php file. I searched on google and the best answered I could ...
0
votes
0answers
121 views

How to order query by numeric meta value?

I cannot order my query by meta value by numbers, and ordering by post order does not work too. This is my code: <?php $args = array( 'posts_per_page' => '-1', 'post_type' => ...
0
votes
1answer
74 views

Building theme so user can change header image [closed]

My Google-Fu is letting me down so I'm trying it here. I'm building a theme and I want the customer to be able to change the header image him/herself in the wp-admin. How do I go about this? As I ...
0
votes
1answer
28 views

Tags interfering with next_post_link();

I am creating a theme in WordPress. I am using query_posts('tag=front') to limit the posts on the front page. However, I want to let the user navigate through all posts, regardless of tags when on ...
0
votes
2answers
113 views

Transient Loop Not working as expected

So I created a transient object that used get_posts() to get a series of posts based on some argument. Well the transient was stored - it was created - YAY - now I tried to write this loop: public ...
0
votes
1answer
49 views

how to get number of posts in a category on a specific date

I want to get the number of posts for each category on a specific date. I think I can do the following: - get a list of categories - start loop ---create a query for each category and specific date ...
0
votes
1answer
71 views

how to define category loop last class in the third

on my page category.php file i'm using product listing, product block loop is , product-block , product-block , product-block last last class no margin-left, how to define third product "last ...
0
votes
2answers
305 views

How to modify search.php to not show pages only show posts

I want to modify search.php so that it only shows posts and not pages. Can you help? Here is the loop in search.php: <?php if (have_posts()) : ?> <?php while(have_posts()): the_post(); ...
0
votes
2answers
67 views

The Loop isn't working

I can't get the loop to work as it's supposed to, without using the not-so-recommended: <?php query_posts('post_type=post&post_status=publish&paged='. get_query_var('paged')); ?> I'm ...
0
votes
1answer
1k views

Need some help with “the_widget()” function

I am trying to create code to display certain default WordPress widgets on my e-commerce site. I have 6 content boxes which display WordPress widgets: • Pages • Latest Posts • Archive (last ...
0
votes
0answers
2k views

pagination broken - clicking next displays “page not found”

I'm a newb at Wordpress, but my HTML/CSS is ok. My site is: http://www.modernfuture.net/wordpress been working on it this for quite some time & I'm done with the headaches, need to get some ...
0
votes
0answers
93 views

Get last 5 days with posts

I am trying to get a solution to this question of mine http://stackoverflow.com/questions/18487639/date-base-archive-on-wordpress-homepage I am trying with multiple loops, if thats possible. But I ...
0
votes
1answer
44 views

WordPress Multiple Loop: Home/Archives Page, with pagination

I can not write English, and I'm using the google translator. I believe that pictures can say more than words. Please watch this. http://i.stack.imgur.com/99YKW.jpg is possible to do something? ...
0
votes
1answer
429 views

Offset WP_Query by negative 1

I have an event loop and I'm wondering if it's possible to offset the loop by -1, so the prev and next posts of the current post are shown. EDIT - Thanks for your comments, I think I can clarify. ...
0
votes
2answers
52 views

Stuck with conflicting loops on page template

I'm really new to WordPress and having a problem with my page template and a sidebar loop. I made a block that displays posts in a category in the sidebar, it also displays a custom field below the ...
0
votes
1answer
44 views

Is there a way to target only images within the loop?

I'm new to WordPress and I'm trying to target specific parts of the content. I understand how to grab the title with get_title() — is there something similar for images?
0
votes
3answers
72 views

Code to check amount of blog posts and add css

Is there any sort of jquery I can use to check if there is only one blog post on the page, then to add custom CSS? And if there is more than one, add different CSS? <div class="main-blog top ...
0
votes
0answers
41 views

Turn post into simple slideshow

I'm new to WordPress development, but I've coded a template page for a friend. I'm trying to convert the following html into a single post: <div class="container"> <div ...
0
votes
1answer
93 views

Placing the content of one post in two side by side columns, newspaper style

I'm trying to place two columns side by side like a newspaper does and display one post's content within both. I've been trying to explode the content at my h4/90 words and echo the rest of the ...
0
votes
1answer
4k views

Customize WooCommerce Product Images (Placement and size) [closed]

so I'm having trouble trying to re-size my product thumbnail images. The site can be seen here : http://www.seekoften.com/eCommerce . I'd like the single-product page to have square thumbnails below ...
0
votes
0answers
68 views

Changes in a home, two columns

I'm working with this template (this is a demo), I need the post shown on the home to appear in two columns rather smaller in width. Enclosed is my index.php code, I've tried everything by various ...
0
votes
1answer
41 views

Loop not showing first post

I've set up the following loop on a page, but it is missing out the first post. Does anyone know why this might be? <div class="gallery"> <?php if (have_posts()) : while (have_posts()) : ...
0
votes
1answer
643 views

wp_query orderby random do not repeat infinite scroll - one loop

I have found a lot of documentation on solving this issue with multiple loops, I'm finding it hard to see a solution for one custom loop. Problem: I'm using infinite scroll to load in the next page ...
0
votes
1answer
40 views

Get query result before posts are displayed?

If I want to modify the query, I can use pre_get_posts filter. But what if I want to loop through the queried posts before they are ran through the The Loop? Is there a filter/action hook for that? I ...
0
votes
1answer
469 views

Custom Taxonomy + JQuery Tabs

I have created small widget on my home page which is using JQuery tabs plugin. So tabs nav is made of custom taxonomy titles and content below should be relevant to those tabs. So in other words every ...
0
votes
1answer
110 views

Show posted on date only for posts in a certain category

I am using a lot of custom post types throught my site and don't want to show a "posted on" date on them. I only want date to be shown for the post in "Featured" category. I've made some changes in ...
0
votes
0answers
23 views

Wordpress Group By Problem

i have a custom post type called "events". in this post type, i have a metabox with the date of the event. saved as timestamp. my problem is, i want a whole year with every month. current only the ...
0
votes
2answers
87 views

Conditional Check in The Loop's Parameters

I have several loops each of them built to display a certain category in different style, based on user's input (they're within shortcodes). Now I want to "merge" these (or just 1 of them) loops with ...
0
votes
1answer
4k views

Twitter bootstrap carousel multiple items in carousel

I'm pulling in posts from a specific category using twitter bootstrap carousel rotator. I've looking into double loops but I can't figure out how to implement it. Here is my loop: $query = array( ...
0
votes
1answer
406 views

Create a custom taxonomy template that loops through child categories in term order?

We're building a site that sells Biking Gear We're using the Genesis Theme Framework, and developing a custom child theme. It has a Custom Post Type for Products, made with the "Custom Post Type UI ...
0
votes
1answer
75 views

Loop to get current parent page “content” and his children content

I am tring to write a loop to get the content of a current-page; and below the content of every children of this page. After reading on wordpress codex website and outside on the web; I can't still ...
0
votes
2answers
32 views

Sorting custom post types by taxonomy (So close)

I have a custom post type called 'requests' that has a custom taxonomy 'request-categories'. I've created a template with a modified loop that allows me to view my custom post type in a certain ...
0
votes
0answers
724 views

The Loop won't display page or post content

I can't get the page content to appear in my custom wordpress theme. I have an extremely simple version of The Loop, which should just display the title and the content of the current page or posts. ...
0
votes
0answers
372 views

Show all posts using the template page and the loop?

I am trying to make a template page that would display all posts from all categories, in short - every post added to my website. I was googling around and found out that it can be done by using The ...
0
votes
1answer
61 views

Inserting random posts

I'm wanting to add 2 custom post types to a slider, one is Events the other is Core Values but I am wanting to add all events and randomly insert only 2 or 3 of the 7 core values. I have this query ...
0
votes
1answer
249 views

Multisite redirect loop for a single www domain

I have been using WordPress multisite for several years without a problem. At some point in the last few days one of my many multisite domains is stuck in a redirection loop. The domain is ...
0
votes
1answer
116 views

Nested loop called with shortcode duplicating the content above the main loop

I'm trying to use a shortcode to call one post from a custom post type and display it inside another page's content. (Basically, we have a custom post type called 'testimonials' and we want to display ...
0
votes
1answer
148 views

2 loops in archive.php (one for each category)

I have a custom post type set up for a news blog on a site I'm building, the custom post type being blog consisting of 2 categories, blog-image-post ID=3 and blog-text-post ID=4. I want to loop each ...
0
votes
1answer
95 views

the_post_thumbnail unless video id is added

I have 2 choices on the edit post page to insert an video ID from either vimeo or youtube. The user needs to select, with a select field (channel), if he wants to embed video from one or the other. ...
0
votes
1answer
91 views

My Query is getting the wrong data

I am trying to populate a select box to get the categories created in my ACF post type, when clicked these will filter available jobs via their category. The post type can be seen here - Post Type ...