The core of the WordPress query, the loop offers an easy way to access post information and display it on your website.
-2
votes
0answers
13 views
Pagination doesn’t work with page navigation [duplicate]
My pagination doesn't work with pagenavi. This my code:
<div class="zilla-one-half">
<?php query_posts('showposts=3');?>
<?php if (have_posts()) : while (have_posts()) : ...
1
vote
3answers
243 views
Recent posts on a static home page
I want a static home page on my wordpress website, I have already set this up and have a bit of content on it, the next step is I want to have 5 recent posts underneath the content. As a normal page ...
1
vote
1answer
451 views
ajax for filtering posts by category in wordpress loops
I've been looking around for a way to filter my posts on http://www.waziproject.com/wazimagazine/ without reloading the page.
So my question is if anyone can help me out to turn the following into a ...
0
votes
1answer
105 views
Search.php - return number of results but cannot loop through
I have a following search.php page (this is just the code required for problem presentation).
Why is my $total_results returning a number of posts found, but when I do a loop though it always print ...
-1
votes
0answers
24 views
get_terms wordpress
I created one PHP class that has a method which is using get_terms() function of word press. Then I am creating the object of that class in other PHP file and calling that method, the method is called ...
0
votes
0answers
23 views
I have a complicated loop query, that I want to output into grids
The code below loops taxonomies, then loops posts within each taxonomy. I would like each taxonomy group put into a CSS grid column.
How do I get this into grid rows correctly?
<?php ...
0
votes
2answers
265 views
How to show custom post type on homepage and in catergories
Details
Wordpress Version: 3.4
Theme Deadline Version 1.2
Site URL: http://www.littlenomads.com
Plugin being used to create the Custom Posts Types
...
-1
votes
1answer
19 views
Eliminate duplicates in a foreach loop [closed]
I've created a filter for my search results that allows people to filter user searches based on their State from their profile. The problem I am having is that there are duplicate states showing in ...
-1
votes
1answer
9 views
Multiple loop with pagination in same page
In my home page i have two <section> in which i perform two different loops on different post categories. Here the code:
<section>
<ul class="loop-article">
...
0
votes
1answer
117 views
Home page loop with pagination problem
I used a loop to display posts from specific categories, then add the code for WP_Paginate plugin under that loop ... below my posts I see pagination links from 1 --> 5 , however when I press page 2 ...
0
votes
2answers
266 views
How do I Use Multiple Loops with WP_Query?
Hi I am trying to add post from a certain taxonomy term to a cpt loop. The code below is the code I am using.
<?php // Create empty array to store post ids in
$excludes = array();
...
0
votes
1answer
38 views
Pagination and multiple loops
Right, so what I currently have is a page split into three using a css grid. The third column is the sidebar, The first two each have a query for posts to display, and create a nice grid of posts ...
-1
votes
1answer
25 views
query posts in wordpress
I want to filter my query results just before the_loop starts in word press. I only want the results having term_id or term_taxonomy_id equal to 1.
...
3
votes
1answer
181 views
How to show list of posts by author and category?
Let three categories and their IDs:
cat1 = 1 (parent)
cat2 = 2 (child of cat1, parent of cat3)
cat3 = 3 (child of cat2)
Let each category has 3 posts, they are: post1, post2, post3.
And each posts ...
0
votes
1answer
13 views
display post thumbnail for specific category outside of loop
I'm building a theme that features a section wherein I'd like to have the single most recent post's thumbnail of a single category displayed between the header and blog sections. Something like ...
0
votes
1answer
21 views
wordpress taxonomy results
I am using taxonomy.php to fetch some rows from database. On taxonomy page the function get_queried_object() shows that I have got the right results from database but wordpress loop if ( have_posts() ...
0
votes
1answer
416 views
A two column loop with one lead post
I got a loop from internet (I forgot the site) for two column post view. It has a nice CSS for it too. But skipping that for the question now.
<?php $counter = 1; ?>
<?php ...
0
votes
1answer
9 views
Pull Instagram images into an existing loop?
I am looking for a solution to pull Instagram images (from a single account) into a Wordpress loop and mix them chronologically with standard posts that will have been created within the Wordpress ...
0
votes
1answer
24 views
Control content before and after custom post type loop
I am trying to create a left nav menu that contains a couple of different taxonomy lists of a custom post type. For example, the left menu might look like this...
<h2>New Stuff</h2>
...
0
votes
1answer
21 views
List post only under the category, exclude child category content
I wanted to list posts which are directly under a category and not inside the "sub category". In other words, I want to hide all the posts which are from "Sub Category" in the Parent category view.
...
0
votes
2answers
66 views
PHP if post is already displayed, then
I have created a new page with a jquery carousel which rotates between various different news topics. You can see here:
However below the carousel is a static list of additional headlines. What I ...
0
votes
0answers
30 views
Advise on Templates for Custom Queries
I'm trying to figure out the best way to solve this problem. I have a couple of archive type pages that display content from multiple post types at once. For example, I've overridden the default ...
0
votes
1answer
35 views
WooCommerce checkout gateway creating redirect loop
I have set up PayPal as my payment gateway for WooCommerce, do not have an SSL certificate, and am not forcing SSL. Checkout and payment are set to go to the checkout page. When I try to test the ...
0
votes
3answers
76 views
is_home, and is_front_page conditional problem
I have this snippet in a "portfolio-loop.php" file. I'm using get_template_part to display the loop on the front page and on other pages.
I have this within the loop:
<?php if( !is_home() || ...
2
votes
2answers
116 views
Rearranging posts based on categories
Hey everyone on Stackexchange!
I'm trying to find a way to prioritize posts based on a category in a loop, which is sorted by dates. All posts are grouped under their respective dates. The date ...
0
votes
2answers
35 views
Identify the page being shown while in The Loop
In my loop, I'm trying to set it so that certain text is displayed on certain pages, if there are no posts to display.
I thought this would be simple, using is_post(), but it seems that this function ...
0
votes
2answers
143 views
How to group the loop posts in a particular by author?
I have links going to category pages on a WordPress blog. These category pages show all the posts that are in that category and sub-categories. I want to group these lists by the authors.
I guess ...
0
votes
1answer
130 views
Converting multiple loops into one single loop with pagination
I am using Isotope jquery plugin to filter/sort posts in Wordpress but to correctly filter the posts into the right order I have needed to output each category one after the other. To do this I've ...
0
votes
1answer
17 views
My custom query not detecting the correct category
For category.php my custom query code isn't displaying the posts from the correct category.
I have a parent category called 'Blog' and it can have any number of unknown children. With that in mind ...
0
votes
2answers
48 views
Interrogate a page within a loop to check template type or custom meta data (Pages vs Posts)
I've spent a few days researching working with WP static pages - as separate from posts.
Although I've found useful guidance, I can't seem to find any good tutorials or worked examples that show me ...
0
votes
2answers
24 views
Showing related posts (custom post type) outside of the loop
I'm trying the following (it's a sidebar widget in the Single New template):
<ul class="featured-jobs">
<?php
$postid = $post->ID;
$categories = ...
0
votes
2answers
24 views
How to display first post
I want to display in the front page of my theme the first most recent post in the header and then continuing the loop in the main content section starting from the second to post and so on, how can i ...
2
votes
1answer
30 views
Can't show comments count per post outside loop
How can I show the amount of a comment per post outside the loop? I tried this in a function already:
' . get_comments_number . ' , but that outputted the text "array" on the screen... What do I have ...
1
vote
2answers
107 views
Query last updated posts (posts updated in the last 24 hours)
I'm having some difficulty to find an example of how to create a loop with posts that had been updated in the last 24 hours.
My idea is to have a page of posts or perhaps on the index.php a lists of ...
0
votes
1answer
26 views
Looping taxonomy in taxonomy?
So I have a CPT of references (like a dictionary kind of format for music).
In it there are two taxonomies: medium_reference and reference_letter.
The reference_letter lists letters A-Z, while ...
-3
votes
2answers
36 views
How can you make it so the comment box shows on some pages or posts but not all?
Pseudo code might look like:
if it's this type of post
display comments and comment box
otherwise
forget it
This same type of code should also allow someone to have HTTP requests if it's ...
-1
votes
1answer
34 views
Trying to display posts but getting the pages as output
I am trying to display the posts on my front page of the roots theme's base.php file.
I have added the loop as
<?php while (have_posts()) : the_post(); ?>
<?php
echo ...
1
vote
1answer
314 views
Facebook “like” open graph meta in header.php
I would like to add open graph meta tags to my header.php, but can someone explain how this works if header.php comes before my loop with the relevant information??
<meta property="og:title" ...
0
votes
1answer
173 views
Open Graph in Index Loop
I have an index of posts where I'm wanting to insert a Facebook Like button for each post. Thus far, I've set all Open Graph data in the head for single posts. Any ideas on using the open graph data ...
0
votes
1answer
85 views
Pagination not working on home page
I've a page named "share" with a complex loop that's working perfectly. This page is located at domain.com/share. Now I need to use this page as the home page, so I went to "Settings -> Reading" and ...
1
vote
2answers
419 views
Why do next pages load the same content rather then older articles?
For some reason, the 'previous posts' and 'next posts' on the homepage do not load previous posts, but rather the same posts that were on the main page.
Why is that? I don't even know where to start ...
0
votes
1answer
19 views
Category archive is displaying all posts rather than the specific category
Here is my loop code for index.php . I do not have an archive or category.php right now. This is very basic.
$temp = $wp_query;
global $wp_query;
$wp_query = new WP_Query();
...
0
votes
1answer
32 views
Custom search form to display users only
I'm trying to build a custom search form for one of my pages. I need the search form to be able to search for users. Not only will it need to search for users, but by first name, last name etc.. ...
0
votes
1answer
25 views
For Each +1 Wordpress Loop
Im using a loop to make a slider. My code is
<?php
query_posts( array( 'post_type' => 'my_gallery', 'author'=>$author->ID ) );
while( have_posts() ) :
the_post();
$imagethum = ...
0
votes
2answers
2k views
Loop not allowing infinite scroll after post per page limit
Im using masonry with infinite scroll to display posts in a loop. I set the post per page which works great on the index page but when I place that same loop on a single page or a buddypress profile ...
0
votes
2answers
36 views
“Right Way” to make custom Loop respect reading settings inside admin panel?
I have created custom Wordpress loop using WP_Query, loop is working fine and I can customize it nicely, however i have a problem using "Blog pages show at most" settings, for example inside my loop ...
2
votes
2answers
293 views
How to order results by date and meta key?
I'm using wp-postratings to rate posts which stores the rating as a custom meta value ratings_score. It gives you the option to use r_sortby to order the loop by highest rated but I want to give it a ...
-1
votes
2answers
28 views
Why don't some template tags work when querying information on single.php?
I'm trying to fetch content about the current post into the header.php of my theme (to dynamically insert Facebook OpenGraph Metadata).
Since I'm on a single post page, shouldn't it be able to run ...
0
votes
1answer
35 views
the_content not working on one of two Multisite sites
I have a multisite with two subsites (sub-domain setup)
both sites have the same theme, same plugins but the first one is in Hebrew and the Second in English.
On certain templates (not all) in the ...
0
votes
0answers
20 views
Run a query when in last category
Can anyone help? ive searched google but with no luck.
currently Accounts has sub categories but no posts
/accounts/ = /billing1/ + /finance/
Billing and finance have posts but don't want ...