Timeline for "Sticky" posts for each category (archive.php)
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 13, 2019 at 22:22 | comment | added | Just a nice guy | Hi, I know this post is old, but please look at the answer of @bz-mof so you can update yours and make more helpfull your post. | |
Apr 13, 2017 at 12:37 | history | edited | CommunityBot |
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
|
|
Nov 15, 2016 at 12:11 | comment | added | turzifer | Thank you for the good, clean reply and the code. I must admit, it took me two days to see that I need to put the two functions in functions.php. I was trying to get it to work in archive.php. Maybe you can make it a little more obvious, so not-very-good-readers like me can benefit from your answer better. | |
Jun 4, 2015 at 16:12 | comment | added | Pieter Goosen | Let us continue this discussion in chat. | |
Jun 4, 2015 at 16:11 | comment | added | Django Reinhardt | It seems the documentation is badly worded. The only behaviour it suppresses is the prepending, not the including. | |
Jun 4, 2015 at 16:09 | comment | added | Django Reinhardt |
That's definitely not my understanding of it, or what the documentation says: false (default): move sticky posts to the start of the set. true: do not move sticky posts to the start of the set. Sticky posts are still gotten, even if it's set to true.
|
|
Jun 4, 2015 at 16:07 | comment | added | Pieter Goosen |
No, ignore_sticky_posts by default is set to false, which means that the query must include sticky posts in the query. When setting it to 1 or true, the query ignores/skip sticky posts and they are thus excluded
|
|
Jun 4, 2015 at 16:04 | comment | added | Django Reinhardt |
Hmm. As I understand it, all ignore_sticky_posts does is move stickied posts to the front the queue, or keep them in their place.
|
|
Jun 4, 2015 at 16:01 | comment | added | Pieter Goosen | As reference, check this | |
Jun 4, 2015 at 15:59 | comment | added | Pieter Goosen |
That is to ignore sticky posts. I know it makes no sense, but with post__in , the ID's supplied are used to get the posts. On top of that, all posts that are marked sticky is also returned. This is what we want to avoid, we don't want to check for stickies. For you, as a test, remove that parameter. You will notice that all stickies are returned regardless of category. :-)
|
|
Jun 4, 2015 at 15:55 | comment | added | Django Reinhardt |
Why are you using ignore_sticky_posts ?
|
|
Jun 4, 2015 at 15:54 | vote | accept | Django Reinhardt | ||
Jun 4, 2015 at 15:52 | history | edited | Pieter Goosen | CC BY-SA 3.0 |
deleted 135 characters in body
|
Jun 4, 2015 at 12:38 | history | answered | Pieter Goosen | CC BY-SA 3.0 |