The tag has no wiki summary.

learn more… | top users | synonyms

12
votes
1answer
1k views

Sticky Posts exceed posts per page limit

I'm using pre_get_posts to adjust the number of posts displayed on my homepage. function lifelounge_query_adjust( $query ) { if ( is_home() ) { set_query_var( 'posts_per_page', 12 ); ...
6
votes
3answers
635 views

How to add “Stick this post to the front page” to front end?

I have a baseball related website with multiple authors. I use the "Stick this post to the front page" to denote an "Editor's Pick" on an article. I would like to add a link/button to allow editor to ...
5
votes
1answer
539 views

Show all sticky posts, WITH pagination

Trying to get a custom admin link working for a custom post type. I've managed to add a link to show all "sticky" posts next to the usual "All", "Published", "Trash", etc., but the actual query isn't ...
4
votes
1answer
779 views

Highlight a Featured Post?

I would like to "highlight" a featured post above all other posts with a special indicator. Is there a feature in WordPress that will do this or do I need to install a third party plug-in? I am ...
4
votes
1answer
325 views

Code to make a post sticky

How is it possible to upgrade a post to make it sticky directly from code, not by admin area? Is it possible through a code like: update_post_meta($post_id, $meta_key, $meta_value, $prev_value); In ...
4
votes
2answers
3k views

How to make my front page display only the most recent sticky post, plus usual widgets?

WP 3.3.1, Suffusion 4.0.2 I am trying to figure out how to make my front page display only the most recent post marked sticky. I can't find how to do this in the documentation. What I'm trying to ...
4
votes
2answers
2k views

Show Sticky Posts in Category Archive

I'd like to be able to show sticky posts at the top of category pages. I'm using archive.php for my category page. I'm using the code below to display sticky posts at the top of my category archive ...
4
votes
1answer
322 views

Limiting query_posts to 1, regardless of sticky post?

As part of my homepage template, using the standard query_posts I'm pulling out 1 post (styled using a different content_part), then an ad, then the rest of the posts. This works fine, except for when ...
4
votes
1answer
488 views

How do I show sticky posts on a static front page that also contains content?

In my theme, I'm using front-page.php for the static front page. I'm also using a page to store the content on the static front page. The front-page.php file is set up to show the content from that ...
4
votes
0answers
555 views

Sticky Posts & Posts Per Page [closed]

I notice that sticky posts will disregard the posts_per_page param? Like I have a query like $q = new WP_Query(array( 'posts_per_page' => 4, ... )); If there are 3 sticky posts, I will get 6 ...
2
votes
2answers
830 views

Using categories & “stickyness” together

I've got a custom query on my homepage showing all posts in a certain category. I need this query to respect sticky posts, but it seems from my research that category queries ignore stickyness. My ...
2
votes
2answers
3k views

Wordpress 3.1 - How does one add sticky post capabilities to post types

In wordpress 3.1 they finally added the option of allowing posts belonging to a custom post type to be marked as "sticky"... what I can't figure out though is how to enable this so the admin menu ...
2
votes
2answers
2k views

Sticky post for each category on category pages

I think the title is self explanitory. I would like to show category.php a post I set as sticky post for that category. Do you know a good plugin or a code to do this? Thanks, Sarit
2
votes
1answer
852 views

Exclude Sticky posts from Main Query break Pagination

I have a small problem with this function ! I would like to exclude all sticky post from my query but when I do it, it breaks my pagination. In the following code, when I remove the "'post__not_in' => ...
2
votes
1answer
113 views

Display only the most recent sticky post, display other posts in chronological order

I want to display only the most recent sticky post at the top of the TwentyEleven page, and display the rest of the posts in chronological order, no matter whether they are sticky or not. I tried to ...
2
votes
0answers
34 views

How to include sticky posts in 'Blog pages show at most' X number of posts?

I'm using the default Loop Code. I've set the 'Blog pages show at most' option in Settings > Reading to 11. In my home page -set to show Latest Posts- whenever I mark a post as 'Sticky' it's being ...
2
votes
1answer
1k views

Adding Sticky functionality to Custom Post Type Archives

In WordPress, Custom Post Types do not have Sticky functionality as a core feature. It is possible, I'm sure, to create it in certain cases—and I'm working on a project that requires it for ...
2
votes
2answers
763 views

Display all custom post type posts and order them by an optional meta_key

I have a custom post type (CPT) called property. I have registered a featured property metaboxfor it as explained in this question "How do I create a featured post within a custom post type?". So a ...
1
vote
3answers
2k views

ignore_sticky_posts in WordPress 3.0.3?

I am using WP 3.0.3 and I would like to exclude sticky posts from my query: This doesn't seem to work: <?php query_posts( 'posts_per_page=9&cat=-1,-2&ignore_sticky_posts=1' );?> To ...
1
vote
1answer
1k views

Ensuring sticky posts are retrieved first (without using two queries)?

I need to maintain pagination for use with infinite scroll. Is there no way to tell query_posts to retrieve sticky posts first? It seems to be default behaviour on a standard wordpress blog on the ...
1
vote
2answers
582 views

Exclude sticky post from main query?

I am having alot of trouble with this. I was using <?php query_posts( array( 'post__not_in' => get_option( 'sticky_posts' ), 'paged' => get_query_var( 'paged' ) ) ); ?> to exclude the ...
1
vote
2answers
2k views

Excluding Sticky Posts from The Loop and from WP_Query() in WordPress?

The following snippet is from a sidebar widget that lists "recent posts". Since its on the home page and I feature my lastest sticky post prominently on that page, I want to skip over the sticky in ...
1
vote
3answers
2k views

wp_query for the first sticky, then display the rest of the posts excluding the first sticky

I've been reading this by @nacin and getting to grips with wp_query over query_posts that I used to use. What I want is: to put this in a template file to query all posts of this category, in this ...
1
vote
1answer
73 views

How to get 1 or 2 specific posts on top of my wordpress blog?

Does anyone know how to get 1 or 2 specific posts on top of my wordpress blog all the time? I mean just like in a forum where you can sticky a post so they are always on top of the other posts. Is ...
1
vote
1answer
82 views

Move sticky posts down in main loop

Currently I am working for a site which runs on WordPress, and using twenty thirteen theme which already has a sticky post function built in and working reasonably well. But I do not like how a ...
1
vote
2answers
855 views

Front page should display only one category of posts including sticky post with custom featured post box

I need code to get one category - including its sticky post and a custom featured post box on my front page. I am using twenty twelve. I have created a child theme. I have wordpress 3.6 on a ...
1
vote
1answer
86 views

Keep sticky posts out of query unless they have featured image

I have a query running which prevents posts without various criteria from appearing, one of these is the necessity to have a featured image. Sticky posts however seem to end up in the query ...
1
vote
2answers
484 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' => ...
1
vote
1answer
274 views

How to stick custom post at the top in search results

I'm trying to stick a post in the search results for the value and meta_key meta_value. If the search results in the post is meta_key - sticky and meta_value - fatured, the display on top of these ...
1
vote
1answer
615 views

How to make “sticky” pages (and query by them)

I have query_posts() with page_type set as 'page'. Is there any way I can make certain pages appear higher and thus, make them sticky?
1
vote
0answers
339 views

How to use custom fields to enable sticky posts on custom post types?

Background: The Wordpress Answers site has two questions which ask about how to enable sticky posts on custom post types (see how to make custom posts sticky? and Enable sticky posts to custom ...
1
vote
2answers
287 views

Sticky post appears twice

I am trying to modify the number of posts_per_page in the loop. This way: function posts_per_page($query) { $query->query_vars['posts_per_page'] = 3; } add_filter('pre_get_posts', ...
1
vote
1answer
643 views

How can I make a custom post type sticky?

I installed the "Sticky Custom Post Types" plugin, and I added this code to my function.php: function wpb_cpt_sticky_at_top( $posts ) { // apply it on the archives only if ( is_main_query() ...
1
vote
1answer
184 views

How to display only feautured/sticky listings on the homepage

I want on my homepage on my first page to be displayed only featured listings no matter how old they are This is my homepage code: <?php get_header(); ?> <?php ...
1
vote
1answer
129 views

Schedule Sticky Posts

I'd like to display the most two recent published sticky posts by modifying the primary loop. A simple affair with the following loop. However, if I schedule a sticky post to be published in the ...
1
vote
0answers
79 views

Difficulty with PHP function that displays a post's format in WordPress

I am working on a WordPress theme using Bones. I would like to be able to show some text just above the title of each post if the post is either featured, password protected or private. So far I came ...
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
1answer
204 views

Exclude all sticky posts front page twenty twelve

I am attempting to exclude all sticky posts from my front page in twenty twelve theme. I have attempted the following. I am making all changes to the child theme. To remove the following code from ...
0
votes
3answers
125 views

How to automate featured posts number? [duplicate]

Possible Duplicate: featuring old articles without messing up with the archive Let's say you have a category called "featured". and you use that to feature posts. And the theme you have has ...
0
votes
4answers
406 views

How to get bbpress sticky topics

I want to get bbpress sticky topics using query like this: $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice( $sticky, 0, 2); query_posts( array( ...
0
votes
1answer
27 views

Display image for first sticky post only

Working on news paper site here i am using sticky.I want display first 6 sticky post its displaying very good but problem is that every sticky showing there post image(feature image) here i just want ...
0
votes
1answer
89 views

Exclude current sticky post

I have the following query, trying to fetch the latest sticky posts but exclude the current one: $sticky = get_option('sticky_posts'); rsort( $sticky ); $sticky = array_slice($sticky, 0, 3); ...
0
votes
1answer
55 views

Why: sticky front page code, shows latest non-sticky on logged-in front page

I have this code to display only the latest sticky post on the front page. the strange thing is that, when I'm logged-in it shows non-sticky latest post, even if it's private... <?php ...
0
votes
2answers
268 views

I would like to change the sticky posts label “Featured” to something else

On the posts that we label "sticky" the word "featured" appears. How can I change that to "new"? David
0
votes
2answers
1k views

Custom query: how to get the sticky posts first?

I noticed that if I code a custom WP_Query, sticky posts don't show first in the list. So I was wandering how to achieve that. I've almost done it with 3 subsequent queries, but I guess there must be ...
0
votes
1answer
173 views

Can't get pagination to work for sticky posts only

I don't get my pagination to work. I need to filter my posts on sticky posts and display only two per page. Tried almost everything but can't get it to work. It is totally ignoring my posts_per_page ...
0
votes
2answers
529 views

How to display sticky post with custom html

I'd like to display 9 posts and be able to insert a sticky post with its custom html template in between 4th & 5th post. Currently the sticky post gets displayed in both the "sticky container" and ...
0
votes
2answers
1k 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?
0
votes
1answer
25 views

Issue with first top post display order

Here i am trying to display top 6 post recent added post.But the problem is that first top post not displaying code is displaying top 6 post from top 2nd post except the top 1st post. Bellow is ...
0
votes
1answer
128 views

ignore_sticky_posts not working with word press version 3.9.1

I am trying to display a sticky post by its category id. The sticky post is displayed, but the problem is that the published sticky post is displayed twice. You can see from the snap shot below that ...