-
-
Notifications
You must be signed in to change notification settings - Fork 82
Correcting bug in largo_load_more_posts_choose_partial #1021
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This will not break Chicago Catalyst, which has both the 'content-archive' and 'content-search' partials. Chicago Catalyst is currently broken. Chicago Catalyst currently loads the 'content-search' partial in search.php and loads the 'content-archive' partial in LMP. Chicago Catalyst and The Lens NOLA are the only sites defining content-search, and The Lens is not on Largo 0.current, and thus is not affected by this pull request. We should load the search partial in LMP on search pages, or not at all.
This has been updated with a fix for #1023 for AJ-3. This seemed like the best place to apply that fix, because the solution to that fix needed to fix both LMP and the search page. I discovered that the search page uses The split in the current code was introduced in #925: https://github.com/INN/Largo/pull/925/files#diff-398a118e99c24ab047a94c1a898033e9R163 Looking at that PR, it doesn't appear that we were using
|
…hp if the post is being rendered on a search page.
Search results, both on initial load and further posts loaded using LMP, should use the content-search partial. This got changed at some point but is one of the bugs noted in that AJ ticket. In short: the search pages look like crap and we should use the content-search partial to make them appear more like traditional search results, make the individual entries more compact, etc. |
Okay, it'll use |
… put it in a new largo default, partials/content-search.php
…ose_partial ,and fix tests.
Correcting bug in largo_load_more_posts_choose_partial, adding filters, etc.
Changes
Functionality:
largo_load_more_posts_choose_partial()
:largo_load_more_posts_choose_partial()
largo_load_more_posts_choose_partial()
doesn't require$_POST['is_series_landing']
to be set in order to run.largo_load_more_posts_choose_partial()
now checks inside thequery_vars
property of theWP_Query
object, not various properties of theWP_Query
. This should fix the problem where it was returning 'home' for categories and author archives.largo_load_more_posts_choose_partial()
now returns 'search' on search pages, meaning that thepartials/content-search
partial will be loaded on search. Since Largo does not ship that partial, this will fall back topartials/content.php
.largo_load_more_posts_choose_partial()
andsearch.php
now uselargo_get_partial_by_post_type()
to determine the correct partial for a post type. (Search view should use LMP-style partial chooser, not use featured style for homepage featured posts. #1023)partials/content.php
was the fallback partial on the search page, because Largo didn't ship apartials/content-search.php
. Largo now ships that partial.largo_get_partial_by_post_type()
that returnsargolinks
if the post type isargolinks
, and runs a new filterlargo_partial_by_post_type
on the partial. This allows LMP to use plugin-defined and theme-defined partials as appropriate. (Search view should use LMP-style partial chooser, not use featured style for homepage featured posts. #1023)search.php
largo_load_more_posts_choose_partial()
andsearch.php
now uselargo_get_partial_by_post_type()
to determine the correct partial for a post type. (Search view should use LMP-style partial chooser, not use featured style for homepage featured posts. #1023)Tests:
largo_load_more_posts_choose_partial()
largo_load_more_posts()
andlargo_get_partial_by_post_type()
argolinks
post type.Questions:
see Correcting bug in largo_load_more_posts_choose_partial #1021 (comment)Why
For #1018 and we-47.
For #1023 and AJ-3