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
-
Filtering results directly from
$pages
variable 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
.archive
extension.After that, you can do the archives loop before the main pages loop manually, by fetching all pages with
.archive
extension. 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 asticky
property to the archive page as an indicator that the archive page is designated to be a sticky post:In
.\lot\layout\index.php
file:In
.\lot\layout\pages.php
file:In
.\lot\layout\asset\css\index.css
:Beta Was this translation helpful? Give feedback.
All reactions