You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The function largo_category_archive_posts messes with the category posts query in order to facilitate the category featured posts. If someone modifies category.php to remove one section of the featured header, but doesn't modify largo_category_archive_posts, then posts will go missing on the category page.
For sites experiencing this issue, the simple fix is to check "Hide the featured posts area on category pages" in Theme Options > Layout > Category Options, but that doesn't preserve the featured header.
Long-term, we should stop using this query hack and instead should use CSS Grid to make the featured header, falling back to the mobile layout of posts in a queue with the sidebar beneath.
Short-term:
add a comment before the secondary-featured area of the template, linking to largo_category_archive_posts and explaining how to change the number of posts excerpted from the top of the query :
The comment should explain that if you're gonna do something that isn't either of "no featured posts" or "5 featured posts", you'll have to remove_action( 'pre_get_posts', 'largo_category_archive_posts', 15 ) and then reregister a similar function that does what you need it to do. There are two primary approaches to replacing that function:
Modifying the function to not perform the featured post removal on certain queries
requires remove_action'ing this function and then add_action'ing the replacement function
Starting this in 0.6.2 for the comment issue, but in 0.7 or later we should remove the weird hacks and instead just do CSS Grid with a mobile-layout fallback for the outdated 40% of US-based browsers that don't support Grid.
The function largo_category_archive_posts messes with the category posts query in order to facilitate the category featured posts. If someone modifies category.php to remove one section of the featured header, but doesn't modify
largo_category_archive_posts
, then posts will go missing on the category page.For sites experiencing this issue, the simple fix is to check "Hide the featured posts area on category pages" in Theme Options > Layout > Category Options, but that doesn't preserve the featured header.
Long-term, we should stop using this query hack and instead should use CSS Grid to make the featured header, falling back to the mobile layout of posts in a queue with the sidebar beneath.
Short-term:
largo_category_archive_posts
and explaining how to change the number of posts excerpted from the top of the query :https://github.com/INN/largo/blob/d167efce9c2cb3f4a2a15a0d95705a24bca8470b/category.php#L47-L61
The comment should explain that if you're gonna do something that isn't either of "no featured posts" or "5 featured posts", you'll have to
remove_action( 'pre_get_posts', 'largo_category_archive_posts', 15 )
and then reregister a similar function that does what you need it to do. There are two primary approaches to replacing that function:remove_action
'ing this function and thenadd_action
'ing the replacement functionlargo_get_featured_posts_in_category
that returns a different selection of posts for that category.remove_action
'ing this function and thenadd_action
'ing the replacement functionlargo_get_featured_posts_in_category
and replacing that function in templates wherever it is used.The text was updated successfully, but these errors were encountered: