Skip to content
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

sort on page load? #2

Open
boblodi opened this issue Oct 30, 2016 · 2 comments
Open

sort on page load? #2

boblodi opened this issue Oct 30, 2016 · 2 comments

Comments

@boblodi
Copy link

boblodi commented Oct 30, 2016

Hi - great plugin and it worked for me when raw code would not. However, is there a way to call the$grid.isotope({ sortBy: 'whatever' }) while using the plugin? i am using this for a "meet the team" page for a client, and their team members need to be in a particular order. I was hoping to sort by the WP page attributes "order" field.

@robincornett
Copy link
Owner

There may be a way to manage it if I modify the sixtenpress_isotope_options filter, but it may not be possible to do it and maintain backwards compatibility (I'm looking into it). Looking at the isotope docs, though, this filter in isotope will only help you if you are adding the member order as a class to the individual members, right? So you would still need to get the order field added as a class.

What I've done for an archive which needed a custom order was to use the pre_get_posts and modify the query there in the PHP, which has worked nicely, and I think might be an easier approach. Then your ordering is maintained, even if you eventually decide not to use this plugin.

robincornett added a commit that referenced this issue Oct 31, 2016
Allows for unlimited isotope parameters to be set from within the PHP
filter. Addresses issue #2.
@boblodi
Copy link
Author

boblodi commented Oct 31, 2016

Thanks - I can totally give that a shot.

There is also interest in targeting a pre-sort from a link on another
page. I may try to figure that out too...

Robin Cornett wrote:

There may be a way to manage it if I modify the
|sixtenpress_isotope_options| filter, but it may not be possible to do
it and maintain backwards compatibility (I'm looking into it). Looking
at the isotope docs, though, this filter in isotope will only help you
if you are adding the member order as a class to the individual
members, right? So you would still need to get the order field added
as a class.

What I've done for an archive which needed a custom order was to use
the |pre_get_posts| and modify the query
https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
there in the PHP, which has worked nicely, and I think might be an
easier approach. Then your ordering is maintained, even if you
eventually decide not to use this plugin.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAdDuc14Zt-VwYBg6Kx0u-X9BcWRZRJjks5q5en9gaJpZM4KkdoP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants