Tagged Questions
-4
votes
2answers
51 views
How can I display sticky posts at first in wp_query?
I'm looking for a long time, but I could not find a solution. I'm not a coder. Please help me. Here is my wp_query code;
$my_query = new WP_Query('category_name=animals&showposts=10');
while ...
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
votes
2answers
219 views
First post outside of loop, homepage only?
Because of the way my templates are structured, I need to pull the first/sticky post from the site outside of the standard loop, just on the homepage. I'm using _s (underscores.me) as a base, so the ...
0
votes
2answers
260 views
sticky post in custom loop
I have a problem with showing sticky posts in a custom loop. This is the code I'm using to for the custom loop:
<?php
$post_from_cat_a = new WP_Query(array(
'category_name' => ...
0
votes
1answer
659 views
Multiple loops on index page with sticky post and pagination
First post on this site. Hope to get some help from you guys. Probably a simple answer for you experts.
I have two category's (news & work). I want to show on my index page (wordpress ...
0
votes
1answer
81 views
Category sticky latest
I've been trying to write a script that shows the latest (single) post (in a particular category), however, if the user has chosen to have a post be sticky then the sticky post shows. When the sticky ...
1
vote
2answers
3k views
Custom loops, sticky posts, and pagination nightmare
I've tried everything. I've looked at every. single. question. here, on StackOverflow, the WP help forum, googled 10 pages deep and literally tried EVERY combination of code I could find, for the ...
0
votes
2answers
1k views
Multiple loops with / without sticky posts and different post limits
I am having trouble with multiple loops and sticky posts in wordpress.
The first loop I just want all the sticky posts.
<?php query_posts(array('post__in'=>get_option('sticky_posts'), 'cat' ...
0
votes
2answers
818 views
How to retrieve “sticky” post outside the “loop”?
I need to display the "sticky" post in a section that is outside the "loop".
Can someone tell me how to do this?