Tagged Questions
0
votes
0answers
39 views
Showing sticky posts with get_posts()
I'm using this to retrieve posts on my index page:
<?php $posts = get_posts( "category=13&numberposts=2" ); ?>
<?php if( $posts ) : ?>
<?php foreach( $posts as $post ) : ...
1
vote
1answer
224 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
0answers
62 views
Get_Posts() isn't returning the correct amount [closed]
I am using getPosts to retrieve a list of posts in a certain category. However, if I set a category the function only returns 6 posts. However, if I use the function without setting a category, it ...
0
votes
0answers
13 views
Display the most recent post from multiple categories [duplicate]
Possible Duplicate:
Display only the latest post from multiple categories
I have been searching and attempting solutions for over a week with no success. I'm trying to display post ...
0
votes
1answer
253 views
Show last post from multiple categories using wp_list_categories
I have the following code that lists out the children categories on a separate page when you click on its parent category. The code renders a list like so:
Home › Archive for IQ Issue 7
Journal
...
0
votes
2answers
102 views
How to Make infinite loop of post
I am using Post contents as a slider contents, i need to make the post infinite number of loop, ie, If i view the last post after that first post should display and before first post the last post.
...
0
votes
1answer
69 views
Displaying posts on Homepage
I am wondering how to add a column to my homepage that shows the five most recent posts from the blog page located under the "Latest News" heading.
Here is the link to my development site.
...
0
votes
1answer
121 views
get_posts() seemingly ignoring post_type
I am trying to grab posts of post type "leads" (see below for the code I am using) however the query produced (obtained via debug queries) is including the clause 'where post_type in ("leads", ...
2
votes
1answer
280 views
Is it necessary to reset the query after using get_posts()?
Is it necessary to reset the query after using get_posts() ?
I have been looking at this page and I don't see any reference to get_posts() ... I can't make it out for sure from this page either.
I ...
2
votes
1answer
715 views
WP_Query vs get_posts
I have read a number of questions on SE regarding these but I still can't figure the exact difference wrt usage. Would it be true to say that I would probably use WP_Query for the majority of ...
0
votes
3answers
94 views
Delist entries in the_loop
I am trying to add a delisting feature to my WordPress network. Posts which are delisted would not appear in post lists, but would still be visible if accessed directly.
I've written a plugin that ...
0
votes
2answers
100 views
loop inside a loop : search for posts in the same category
Could someone tell me how i could make this work? i have a loop, and i would like to create another loop to find the other posts from the same category : but this does not work :
<?php while ( ...
1
vote
1answer
67 views
Sort posts by most recently modified
Is there a way to list posts in the order in which they were modified?
For example;
A user posts 5 posts (#1 being the oldest and #5 being the newest), by default they would be listed with #5 being ...
0
votes
3answers
414 views
Add class to every other posts using get_posts
I am currently using this little loop to display a list of posts using the "events" custom post type
<?php global $post; // required
$args = array('post_type' => 'events');
...
0
votes
1answer
166 views
Both a page loop and posts loop on the same page
I'm trying to get first the content of a single page (the one that is queried), and then in a small section below i want to display the title of my bloggposts as a "Latest News" section.
The problem ...
0
votes
1answer
237 views
Exclude post format from get_posts
The title basically says it all.
I know I can use the following to get posts from the aside post format:
$args = array(
'post_type'=> 'post',
'post_status' => 'publish',
'order' ...
4
votes
1answer
336 views
How-to exclude terms from the main query the most performant way?
This Q is a follow up to this answer on the Q: "How to exclude a specific term for the search?".
4 ways to filter out posts that have a specific term
Type | Pro | ...
0
votes
1answer
470 views
Magazine style frontpage with multiple categories/loops and no duplicate posts
I am migrating a static magazine site to wordpress. I would like to have a frontpage displaying multiple categories with a few posts in each, e.g "politics", "environment", "health" and "technology". ...
1
vote
1answer
616 views
Adding Pagination on a Custom Author Page
i have created a custom author's page that list the title of their posts. but the problem is i can't get the pagination to work if it's beyond the set post per page value. i have used get_posts() to ...
0
votes
1answer
2k views
How to get The Loop working with $wpdb->get_results()
I am doing a rather complicated custom query on a blog's front page, and trying to show the results using The Loop as shown here: Displaying posts using a custom SELECT query
The query filters posts ...
0
votes
4answers
2k views
Displaying multiple post types on home page
I've read several examples of how to do this but I still can't get it to work - each time I use get_posts() it seems to only keep and display the first set of results.
loop.php
function ...
2
votes
4answers
2k views
How to return results of a get_posts() in explicitly defined order
I'm trying to create a loop of explicity ordered posts, for example:
<?php $args = array(
'include' => '1,3,8,4,12' ); ?>
<?php get_posts( $args ); ?>
The results are ...
0
votes
1answer
172 views
How to create a custom loop ordered by Categories on a Page Template?
Ex.
Category 1
Post 1
Post 2
Post 3
Post ....
Category 2
Post 1
Post 2
Post 3
Post ....
Category ....
Post 1
Post 2
Post 3
Post ....
