Sticky Posts Feature #184
taufik-nurrohman
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Filtering results directly from
$pagesvariable is currently not possible, and is not recommended. Authors are advised to separate the concerns. One of the best ways to make sticky posts feature is to have the target pages separate from the main pages.To practically separate them from the main pages can be done by storing the pages as archives, that is, by saving them with the
.archiveextension.After that, you can do the archives loop before the main pages loop manually, by fetching all pages with
.archiveextension. However, by doing the archives loop only is not enough. Archives need to be filtered further based on certain conditions. For example, you may need to add astickyproperty to the archive page as an indicator that the archive page is designated to be a sticky post:In
.\lot\layout\index.phpfile:In
.\lot\layout\pages.phpfile:In
.\lot\layout\asset\css\index.css:Beta Was this translation helpful? Give feedback.
All reactions