• Resolved jmlbourne

    (@jmlbourne)


    Hi there,

    Thanks for the great plug-in, very useful!

    I have been putting together our gallery of posts, and we’ve been creating many new subpage_title values for each of our posts. (We needed shorter, more susinct names within the gallery).

    Are we able to sort the display of posts alphabetically by “subpage_title”?

    Currently we are sorting by “title”, which is not quite alphabetically correct since the “subpage_title” values have changed.

    I hope that makes sense?

    Currently we’re using something like:
    [autonav display=”posts,thumb” postid=”category:appetisers-accompaniments” count=”100″ orderby=”title”]

    and I was hoping to be able to use something like:
    [autonav display=”posts,thumb” postid=”category:appetisers-accompaniments” count=”100″ orderby=”subpage_title”]

    Can we hack a workaround? Or would you perhaps consider this in a future release?

    Thanks!

    http://ww.wp.xz.cn/extend/plugins/autonav/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Anonymous User

    (@anonymized-126485)

    Currently AutoNav uses WordPress’s built-in sort function; of which the docs say,

    “The sort_column parameter can be used to sort the list of Pages by the descriptor of any field in the wp_post table of the WordPress database.”

    Changing that basic behavior to understand custom fields would be a good request for the WordPress core, but it is non-trivial here.

    Meanwhile, the values are listed here. You might try sorting on the post excerpt, perhaps.

    Thread Starter jmlbourne

    (@jmlbourne)

    Thanks for that, but:

    According to this:
    http://codex.ww.wp.xz.cn/Template_Tags/query_posts#Orderby_Parameters

    WordPress can sort posts by the meta data as well. So surely if Autonav can pass the correct query to WordPress, then it might be possible.

    ie
    orderby=meta_value
    metakey=subpage_title

    Or am I reading that wrong?

    Anonymous User

    (@anonymized-126485)

    As a test, could you try this?

    [autonav orderby="meta_value&metakey=subpage_title"]

    along with your other parameters of course.

    Thread Starter jmlbourne

    (@jmlbourne)

    Thanks but no, that doesn’t seem to work.

    I tried as well with the correctly spelt “meta_key”, not “metakey” as per my original mistake.

    Anything I can change in your code to push it through manually?

    Anonymous User

    (@anonymized-126485)

    Could you please try this test version? I used this as a test:

    [autonav display="posts,list" postid="category:news" orderby="meta:subpage_title" order="asc" pics_only=0 count=10]

    to display a list of ten posts from the ‘news’ category, sorting by subpage_title. pics_only=0 permits posts without thumbnails.

    Note, though, that when you sort by a custom field (meta tag), WordPress will discard any posts or pages that do not have that field.

    Thread Starter jmlbourne

    (@jmlbourne)

    Thanks so much, it works great in v1.3.7!

    I am very appreciative that you were able to include this functionality in the new version.

    Here is my implementation of Autonav in case you’re interested…
    http://itpleasesus.com/recipes/

    Thanks again!

    Anonymous User

    (@anonymized-126485)

    That is one delicious page! Thank you for the kind words.

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

The topic ‘[Plugin: AutoNav Graphical Navigation and Gallery Plugin] Sorting posts by subpage_title?’ is closed to new replies.