• Resolved tjldesigns

    (@tjldesigns)


    Hey Darren,

    I need to order posts by featured, then date. So just checking how I can achieve this…

    1. Can I order by a ACF? This would be my preferred method, but sadly can’t spot anything in the documentation so apologies if it’s there and I’ve missed it.

    2. Do sticky posts work in terms of ordering?

    3. Also just for another requirement, I just wanted to check can I order randomyly? On your website FAQ it says not, but for a future release. But on your Shortcode parameters page you have included it as a possible option >> orderby – Order posts by date, title, name, menu order, random, author, post ID or comment count. Default = ‘date’. So just thought I’d check as I wasn’t sure.

    Thank you πŸ™‚

    https://ww.wp.xz.cn/plugins/ajax-load-more/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hey there!
    1. Did you check out the ACF example? https://connekthq.com/plugins/ajax-load-more/examples/relationship-field/ Does that help?
    2. I do not think so.
    3. That is a mistake you can’t order by random.

    Cheers,

    Thread Starter tjldesigns

    (@tjldesigns)

    Hey Darren,

    Thanks so much for your quick reply, getting there, I now added:

    meta_key="post_featured" meta_value="1" meta_compare="<=" meta_type="NUMERIC" orderby="meta_value_num"

    My field is basically 1 = featured, 0 = not featured, so that is now working – GREAT :). My challenge now is that the Featured element is to override default date ordering, but I need it to fall back to default date ordering as secondary ordering. So it basically shows all featured posts in date order first, followed by all non featured posts in date order, but I don’t think it’s doing that, and is it possible to do that as that would be super useful I think?

    Thank you again πŸ™‚

    Thread Starter tjldesigns

    (@tjldesigns)

    Actually that would be a great future feature to allow for this to be controlled via the builder, ie primary order by (the existing option), then maybe a secondary order by.

    As in my example I need it to revert to default date ordering, but you could have another scenario where say it was a Team page, where you wanted Key Team members at the top, then in this case you would want the secondary ordering to be by say Post title (ie name).

    Anyway I shall stop bugging you now :).

    Thread Starter tjldesigns

    (@tjldesigns)

    Hmmm also just wondered if what I need to do isn’t possible currently, could I amend the ordering via https://connekthq.com/plugins/ajax-load-more/docs/filter-hooks/ > alm_modify_query_args ?

    Thread Starter tjldesigns

    (@tjldesigns)

    Hey Darren, just wanted to check if you had any advice on my ordering thoughts above, hope it makes sense πŸ™‚

    Plugin Author Darren Cooney

    (@dcooney)

    Having a hard time following what you are trying to do.

    If you need to add a second order param just add it like so:

    [ajax_load_more order="meta_value_num date title"]

    Let me know.

    Thread Starter tjldesigns

    (@tjldesigns)

    Hey Darren,

    That’s EXACTLY what I wanted, so sorry! I actually didn’t realise you could order by multiple already as in the shortcode builder it only lets you select one field to order by, so I just stuck with that.

    It’s now working perfect thank you, but for your plugin maybe a future consideration would be to allow to set this via the shortcode builder? Could be really handy.

    Thank you for getting back to me πŸ™‚

    Plugin Author Darren Cooney

    (@dcooney)

    It’s now working perfect thank you, but for your plugin maybe a future consideration would be to allow to set this via the shortcode builder? Could be really handy.

    You’re welcome! A good idea, but maybe I’ll just add some disclamier text that says you can do this.

    Thread Starter tjldesigns

    (@tjldesigns)

    That will be perfect, saves people like me bugging you haha πŸ™‚

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Order by options’ is closed to new replies.