Questions tagged [sticky-post]

When a post is sticky, it (generally) remains at the top of the published posts list, even if there are newer posts. It is possible to have more than one sticky post.

Filter by
Sorted by
Tagged with
0 votes
0 answers
13 views

How to show sticky posts on all pages of the pagination, not just the first page?

Good afternoon! By default, sticky posts are only shown on the first page of the pagination: http://example.com/ ...but should be shown on all pagination pages at the top: http://example.com/ http://...
Pavel Rozhdestvenskiy's user avatar
0 votes
0 answers
140 views

I make sticky post for my archive page for custom post type with ACF field and loop is not working

I make sticky post for my archive page for custom post type with ACF field and loop is not working while($query->have_posts() ){ $query->the_post(); $sticky = get_field('...
Maro Pinčević's user avatar
0 votes
1 answer
52 views

Pagination not working only on Archive-Name.php using new WP_Query

I created an archive-sticky.php where I added the code below to show all sticky posts in one single page with pagination as there will be 100s of sticky posts in the coming days. Now, this code ...
Elaine Byene's user avatar
1 vote
1 answer
56 views

save_post_{CPT} not updating the 'sticky_posts' option

add_action( "save_post_{CPT}", 'update_sticky', 15, 1 ); function update_sticky( $post_id ) { $stickies = get_option( 'sticky_posts' ); if ( ! in_array( $post_id, $stickies ) ) { ...
Tahi Reu's user avatar
  • 216
0 votes
3 answers
2k views

Sticky option for custom post types without using custom fields or plugins

The problem WordPress supports the sticky option with some of its default post types and doesn't provide any option to extend this to other post types. It's hard-coded in the met-boxes.php file: <?...
Jafar Abazeed's user avatar
0 votes
0 answers
54 views

How do you get sticky posts to work with categories?

How do you get sticky posts to work with categories? I have tried: $query->set( 'ignore_sticky_posts', 0 ); but this just results in an out of memory error. I have tried restricting posts on the ...
William Oakley's user avatar
0 votes
1 answer
404 views

How to display sticky or latest published post on the current category page it belongs to?

What I'm able to do : When there is a sticky post in the current category, I'm already able to display it. The problem occurs when there is no sticky post : it doesn't display the latest post as it ...
PhpDoe's user avatar
  • 197
0 votes
0 answers
568 views

Pin posts to top of custom loop

Question What would be the best way to pin certain posts to the beginning of a custom loop that queries for many custom post types and may or may not have tax queries inside? Due to how the rest of ...
Nasif's user avatar
  • 38
0 votes
0 answers
193 views

Sticky Post Doesn't always work

so i have a blog and i want to make a post a sticky post that stays at the top. But for some reason, on the home page where i only display 4 posts, the sticky post doesn't work when the sticky post ...
Sander1020's user avatar
0 votes
0 answers
47 views

How can I have sticky posts while ALSO showing posts from a specific category using one WP_Query?

The Setup I have divided my blog into 3 categories with their respective slugs. There are 3 pages corresponding to these 3 categories with their respective custom page templates. On each page, I ...
Z. Steam's user avatar
1 vote
1 answer
56 views

I'd like to cycle through existing posts in a post type, showing one per day ordered by title, and starting over when the last is reached

Is there a way to feature one single custom post per day on the homepage, cycling through each of about twenty posts alphabetically and then starting over again from the first post? I'm thinking the ...
Matt Reeves's user avatar
0 votes
1 answer
91 views

Exclude Sticky Posts as everyone!

I'm trying to exclude 3 Sticky posts from my blogs loop, I tried some snippets of code, but with no success. I could use some help. <?php if ( $posts->have_posts() ) : ?> <?php /* Start ...
Ioannis Politidis's user avatar
0 votes
0 answers
99 views

Wordpress Sticky Post Count "Fix" Breaking Pagecount by 72 pages!

I have a permanent sticky post on my front page and have implemented the code (pasted below) into my functions.php file to stop it adding an extra post to my post count on the front page (it's a grid ...
Jason's user avatar
  • 13
0 votes
1 answer
62 views

How to pull sticky post permalink inside php?

So, I have the following code written inside my function.php. I use it on my blog post to display the sticky post, but my only issue is I'm not sure how to get the permalink inside my HTML. Also, how ...
Summer Pratt's user avatar
1 vote
1 answer
379 views

Woocommerce - Want to move the product tabs below short description

i've two questions. I would like to move Woocommerce-tabs underneath my short description on the right side. I found this but the accordion is not full-width. remove_action( '...
Henk's user avatar
  • 11
0 votes
0 answers
60 views

Custom Query with Sticky Posts

I’m trying to write a custom query which filters by category and shows only a certain number of posts. So far that’s a simple thing along these lines: $args = array( 'showposts' => 1, 'cat' =>...
mtm's user avatar
  • 41
0 votes
1 answer
280 views

Exclude categories with only sticky posts OR count sticky post of specific category

I want to create a page which displays all categories with posts. My goal is to exclude categories which only has sticky post(s). That's the part which isn't working so far. My current results looks ...
allenstein's user avatar
0 votes
0 answers
160 views

Display Specific Posts at Start of Loop

I'm attempting to mimic 'sticky' functionality on a custom post type using a simple ACF true/false field. I'd like to use pre_get_posts to modify my query to first show my 'sticky' posts at the top ...
Kevin Nugent's user avatar
0 votes
1 answer
59 views

How can I override the post title when a post is set to sticky? [closed]

I want to display my selected post as top post which will appear in the top of my post list. I use sticky post for this, but there is a problem in the sticky post option. It shows selected post at the ...
user166923's user avatar
0 votes
1 answer
62 views

Don't move sticky posts to the first page

After I sticky post, it automatically moves post to the first page and I'd like it to stay at it's recent place. Don't want it to move. How can I do this? I just need sticky post option (i've got an ...
lukasz1950's user avatar
1 vote
1 answer
600 views

Sticky posts not working when a specific category is set

I would like to show sticky posts at the top of an archive list for a specific category on the top page as well as on archive pages. I've been Googling for a working solution and found a few clues ...
Fizzler's user avatar
  • 75
0 votes
1 answer
454 views

How to display sticky post always at the top (before regular post) in wordpress?

I am working on a wordpress code as shown below in which the modified post displays at the top. $temp_args = [ 'post_type' => array('current-channel', 'post', 'current-episodes'), '...
user5447339's user avatar
0 votes
1 answer
139 views

Function for Sticky Post on Categories causes issues with 404 behavior

I want to how sticky posts on category pages and I am using a code on my function.php file in order to manage it. The sticky posts are being shown on the category pages, everything is OK. But with ...
Just a nice guy's user avatar
0 votes
0 answers
82 views

Staggering featured post using 'sticky'

So I have Custom post type that occasionally will have posts marked as 'featured' Client would like to use the 'sticky' feature of WordPress to pick which posts from the CPT are classed as featured ...
Roxy's user avatar
  • 1
0 votes
1 answer
230 views

Add to search posts query array with post IDS which will appear first

Is there a way to add array of post IDS to set posts to be on top of search results? Something like adding a param top_post_ids inside the search hool: $query->set( 'top_post_ids', [45, 78, 94 ] )...
BenB's user avatar
  • 785
0 votes
2 answers
652 views

How to display only sticky posts on my automatically generated front page?

I want to display only the sticky posts on my front page. Right now it's possible to do a setting where the sticky posts are displayed at the top followed by the rest of the posts. I don't want to ...
Aerodynamika's user avatar
0 votes
1 answer
670 views

Make sticky post with FacetWP

I have WordPress posts in combination with Advanced Custom Fields and FacetWP for filtering. WordPress has an option to make a post sticky, I did this and nothing happenend so I tried to change my ...
user2812779's user avatar
0 votes
1 answer
108 views

Latest Sticky Posts with Grid Thumbnails for static front page

i want to make very simple thumbnails grid 4 or 5 images only to show the latest sticky posts with " shortcode to be easy add anywhere " Thanks!
Adham Mohamed's user avatar
-1 votes
2 answers
336 views

Different style for first two (sticky) posts

I'm currently facing a few loose ends while dealing with the homepage of a theme I am working on. I got my loop set up to show the most recent posts in a certain style and it works perfectly. Now I ...
LaMigra's user avatar
2 votes
1 answer
229 views

How to remove sticky post capability for a specific user role?

All is in the title. Does someone know a way to do that ? Thanks !
charlie's user avatar
  • 123
0 votes
1 answer
391 views

How to remove only the latest sticky post from the loop

I know how to remove all of the sticky posts from a loop using the following argument 'post__not_in' => get_option( 'sticky_posts' ), But I am stuck in a problem. I want the loop to load all of ...
Rony Mahmud's user avatar
1 vote
2 answers
420 views

Store sticky post's ids in a transient

I'm developing a theme that has a featured posts section before the main loop of posts. Cool and fresh, right?:) All sticky posts with a featured image in place must be displayed in that section and ...
Nikita's user avatar
  • 419
0 votes
0 answers
113 views

What's difference between "ignore_sticky_posts" and "post__not_in"=>$sticky_posts [duplicate]

what's the difference in results from: new WP_Query( array( 'post__not_in' => get_option( 'sticky_posts' ) ) ); and new WP_Query( array( 'ignore_sticky_posts' => 1 ) ); ?
T.Todua's user avatar
  • 5,719
0 votes
1 answer
239 views

get_previous_post() while accounting for sticky posts

Let's say I have the posts foo, bar and baz. They are published in the following order: 1. foo 2. bar 3. baz If I call get_previous_post() while on the single.php of baz, I'll get bar. I set bar as ...
dodov's user avatar
  • 197
1 vote
1 answer
676 views

Stick multiple posts in a single category

How to stick multiple posts in a single category to show on top of that category? Tried Ideas: I tried to use "Category Sticky Post" plugin, but it only allows me to pin one post for each category. ...
Mohammed Anghabo's user avatar
16 votes
2 answers
25k views

Why ignore_sticky_posts argument is in sticky post query?

We all know that ignore_sticky_posts is used to exclude sticky post from your custom query. But why on WordPress Theme Development documentation, they use ignore_sticky_posts in querying sticky posts? ...
吉 宁's user avatar
  • 414
1 vote
1 answer
507 views

Variable if post is sticky in functions.php

I'm building a shortcode to display certain posts in a page. So far it looks like this: function bloghome( $atts ) { extract( shortcode_atts( array( 'id' => 17 // Add the *default ...
Eric Mitjans's user avatar
3 votes
3 answers
3k views

Disable sticky posts feature

I need to create a custom WordPress admin interface for a client. I want to completely disable the sticky post feature from admin area. I found some posts on the internet that suggest to hide the ...
MKay's user avatar
  • 179
0 votes
4 answers
1k views

How can I allow sticky posts but cap the query to 1 post?

I have a partial that I call around the website at various points. This partial simply displays the latest Post. It looks like so: <?php $args = array( 'posts_per_page' => 1, '...
mikemike's user avatar
  • 265
0 votes
1 answer
44 views

Seach and categories not working when ignoring sticky posts in main loop

My search does not work anymore, the same goes for my categories. It now shows literally all the posts until the page limit is reached, instead of the specified ones. This happened after I made sure ...
CIAOperative's user avatar
1 vote
1 answer
666 views

Change sticky status of posts from phpMyAdmin

I have many sticky posts in my database. Is there any SQL function which I could use from phpMyAdmin to change (remove) sticky status of posts, if post is sticky to change it to not sicky.
Advanced SEO's user avatar
0 votes
1 answer
474 views

Pin to Top Functionality using orderby custom field then event date

I need to accomplish the following: pull CPT tribe_events sort by custom field "pin_to_top" in DESC order get posts from today's date & any in the future sort remaining posts in ASC order My ...
dgfrench's user avatar
0 votes
2 answers
438 views

How to modify query on category pages to show only sticky posts?

I'm using the following code to filter posts on category pages so only sticky posts are displayed. add_action( 'pre_get_posts', function( \WP_Query $q ) { if( ! is_admin() && $q->...
jrcollins's user avatar
  • 561
0 votes
1 answer
273 views

Pull posts from all categories if quantity is not met?

I have a modified theme that displays CPT posts. I am creating a slider that will cycle through all the sticky posts and display them at the top of the page. So far so good. The problem. When I ...
RodeoRamsey's user avatar
  • 1,707
2 votes
0 answers
927 views

Sticky Post default functionality with WP_Query is ignored when using AJAX

I am writing custom ajax pagination for a Blog archive page and I am running into an issue with sticky posts. The default functionality of sticky posts when using a WP_Query call is to sort all ...
hahahelp's user avatar
0 votes
0 answers
298 views

counting post from a wp-query using sticky_post

I'm trying to count the number of sticky_posts inside a specific category. first I get all the sticky posts : $sticky = get_option( 'sticky_posts' ); then here are my args : $args_sticky = array( '...
user2882154's user avatar
0 votes
1 answer
60 views

WP_Query causing links to not work

adding this line of code and adjusting my if statement has damaged my links in the loop. I really don't understand why this has happened. What is wrong with the line of code? <?php $query ...
Samuel's user avatar
  • 155
0 votes
1 answer
2k views

How to display only sticky posts on category pages?

I would really appreciate it if someone could help me with this. I'm trying to get category pages to show only sticky posts from the current category. I was hoping there might be a plugin to do this ...
jrcollins's user avatar
  • 561
1 vote
1 answer
466 views

Include sticky posts on the static page front page

I have a static front page that lists out news. Right now, it ignores the stickiness of a post, and justs lists it. I want it to work the same way as my blog posts page does. I want it to list out all ...
ptf's user avatar
  • 423
1 vote
0 answers
261 views

Sticky posts per category

I need: to have the ability to set one post as sticky in one category and not the others. Example: So let's say i have this three categories: "one" "two" and "three". and i have a post named "sticky ...
Ben's user avatar
  • 359