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
1answer
9 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 ...
0
votes
0answers
25 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 ...
0
votes
0answers
68 views

How to enable sticky post for custom post type with enabled Gutenberg editor?

I was using https://wordpress.org/plugins/custom-post-type-sticky/ for enable sticky post for custom post types. But it doesn't work with new Gutenberg editor. Is there any easy way how to make it ...
0
votes
1answer
26 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 ...
1
vote
1answer
777 views

Pin a post to the top of a page, other than the home page

I'm using a static home page, so my posts go to a different page. How can I pin a post to the top of the page the posts go to (not the home page)? Originally I thought it was as easy as using the edit ...
0
votes
1answer
25 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 ...
0
votes
2answers
368 views

How can I display only sticky posts from a parent category on the homepage?

On my homepage, I have 3 columns showing varying amounts of information from posts in specific categories (first 2 of them child categories, the third column displays posts from various child ...
1
vote
1answer
413 views

Get sticky post from category?

I have parent category is Game cat_id=42. Child categories are : acrade, causual,.... I want show a top game module in mainpage template, it will show 10 sticky post from game category. This my code :...
0
votes
1answer
52 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 ...
0
votes
1answer
24 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'), '...
0
votes
0answers
19 views

Query for get the “Sticky post” of a CPT with 2 taxonomies

I am new in WordPress and I am doing tests, I have created a CPT called ('company') with two taxonomies ('zone' and 'sector'), I want to show me the companies with a certain sector (sector term such ...
1
vote
1answer
63 views
0
votes
1answer
12 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 ...
0
votes
0answers
24 views

Display the Latest Sticky Posts from a category in a widget

I could do it using a code I found, then editing it a litle bit, so i could add css classes on it. Inserted it inside "PHP Everywhere" plugin, and it worked. I made another site, with the same ...
4
votes
2answers
2k 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?
0
votes
0answers
41 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 ...
0
votes
5answers
1k 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( 'post__in'...
0
votes
1answer
22 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 ] )...
0
votes
2answers
184 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 ...
0
votes
0answers
29 views

All sticky posts are displaying on home.php and ignoring tax_query

I'm trying to query the main loop on my home.php template to display posts which are only in a specific taxonomy 'issue-41'. I'm using the pre_get_posts function to achieve this but when testing it, ...
-4
votes
1answer
2k views

Display All Sticky Post Before Regular Post

I would like to display all of my sticky post and then regular post thereafter. I am new to WordPress and not sure how to do this. Any help would be greatly appreciated. --------- ...
21
votes
3answers
6k 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 ); ...
2
votes
2answers
7k 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 archive-{...
0
votes
1answer
126 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 ...
0
votes
1answer
39 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!
2
votes
3answers
3k views

“Sticky” posts for each category (archive.php)

I need to have the ability to have Sticky posts for each category. The simplest way to do this appeared to be to just create two loops on the page. This is what I wrote: <?php //Custom "sticky" ...
0
votes
1answer
265 views

Sticky Post from page 2 and on

Today I updated an old blog post and set it to sticky to show info about the latest changes. It’s a typical post with Site Updates as the title for a log of a sort you could say, with past changes ...
-1
votes
2answers
81 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 ...
0
votes
1answer
132 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 ...
1
vote
2answers
137 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 ...
0
votes
0answers
63 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 ) ); ?
-5
votes
2answers
9k views

How can I display sticky posts at first in wp_query?

I have been 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'); ...
0
votes
1answer
99 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 ...
0
votes
1answer
406 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. ...
1
vote
1answer
247 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.
7
votes
1answer
6k views

why ignore_sticky_posts in sticky post query

We all know that ignore_sticky_posts is used to exclude sticky post from your custom query. But why on codex page https://codex.wordpress.org/Sticky_Posts, they use ignore_sticky_posts in querying ...
1
vote
1answer
213 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 ...
3
votes
3answers
1k views

Sticky posts on home page, search, tag and archives without plugin

I have a question today. I am looking for a solution to make sticky post available on my website. But, i just got it work on homepage with the code below. function wpb_latest_sticky() { /* Get all ...
2
votes
3answers
683 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 ...
0
votes
4answers
365 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, '...
0
votes
1answer
1k views

3 Posts in Loop, Show Stickies First

Okay I am starting to wonder if it is even possible to do this! As I've found very little info on the matter online. This is a fresh WP install that I've been experimenting on so that I can work in a ...
0
votes
1answer
31 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 ...
0
votes
1answer
105 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 ...
0
votes
2answers
199 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->...
3
votes
1answer
4k 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
2k views

How to retrieve sticky post in raw sql?

How I could made a sql query who retrieve all the sticky post in a wordpress database? This is because we use a new app over the old wordpress website database, and I don't know where Wordpress "store"...
0
votes
1answer
97 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 ...
1
vote
0answers
491 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 ...
0
votes
0answers
199 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( '...
0
votes
1answer
47 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 ...