• Hello Simon,
    Not familiar with how to contribute directly to your plugin so I write it here.
    I think you have a bug near line #339 of posts-for-page.php
    I had to change $params[‘order_by’] in $params[‘orderby’] to have my posts sorted the way I wanted.
    And now I can make an order_by=’title’ or ‘rand’ (or I guess any parameters accepted by WP)
    Thanks for your plugin
    Yanick

    https://www.ads-software.com/extend/plugins/posts-for-page/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey Yanibus
    The plugin in its current form accepts order by title but you have to use two parameters eg. order_by=’title’ order=’asc’

    Thread Starter Yanibus

    (@yanibus)

    Hello benclintz

    I tried with both order_by=’title’ and order=’asc’ but it didn’t do anything (except the DESC / ASC which change the order but it is always by date, never by title…)
    Did you manage to sort by title? by author? randomly?

    Because to call the query_posts function the parameter is orderby not order_by (cf https://codex.www.ads-software.com/Class_Reference/WP_Query#Order_.26_Orderby_Parameters) so in posts_for_page.php it should be orderby before calling query_posts and it is not…

    (I work with the last versions of WordPress and this plugin)

    Thanks Yanibus!

    I change $params[‘order_by’] to $params[‘orderby’]. It works! Your suggestion helped me out. I have an upcoming events list which really needs order by title because I add the date at the beginning of each event’s title.

    Thanks again.

    Thread Starter Yanibus

    (@yanibus)

    Happy to have helped you ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Order by 'title' or 'rand'’ is closed to new replies.