WordPress.org

Ready to get started?Download WordPress

Forums

Directory & Classifieds
[resolved] Listings order by alphabet (7 posts)

  1. alucas2k
    Member
    Posted 8 months ago #

    Hi,

    By default the list is ordered by date, but I need to order it by name (A-Z).
    I cannot see how can I do this in the settings. Is it possible?

    If not, in which file and line could I specify the order?

    Many thanks.

    http://wordpress.org/plugins/listings-directory-classifieds/

  2. Mihail Chepovskiy
    Member
    Plugin Author

    Posted 8 months ago #

    This is in functions_ui.php file, in w2dc_orderLinks() function

  3. alucas2k
    Member
    Posted 8 months ago #

    Thanks for the reply.

    I have been trying to force the system only to order by title, but doesn't work.

    I commented everything in the function w2dc_orderLinks() and then just put:

    global $w2dc_instance;
    $ordering = array();
    $class = 'ascending';
    $url = add_query_arg('order_by', 'post_name', $base_url);
    $ordering['post_name'] = '' . __('Date', 'W2DC') . '';
    $ordering = apply_filters('w2dc_ordering_options', $ordering, $base_url);
    echo __('Order by: ', 'W2DC') . implode(' | ', $ordering);

    But this doesn't work. I tried a few more things but nothing happens, the system keeps ordering by date.

    Could you help me please?

    Many thanks

  4. Mihail Chepovskiy
    Member
    Plugin Author

    Posted 8 months ago #

    I'm so sorry, but I haven't any free time to provide whole algorithm for your custom needs.
    May be in further releases we will add default order setting...

  5. alucas2k
    Member
    Posted 8 months ago #

    I thought that was only changing "post_date" by "post_name", but it's not happening that.

    I think that many users will be very happy if you provide this solution.

    Someone who is reading and can help? Many thanks.

  6. alucas2k
    Member
    Posted 8 months ago #

    Well, after looking more deeper, I realized that the function that you said w2dc_orderLinks() only works when the user clicks in the "order by" and in then in the URL appears the GET order_by=title.

    But what I want is by default by title, not when the user click.

    Simple solution and not the best of course, adding ?order_by=title in the end of the URLs in the category list. This is in the file functions_ui.php line 300 (aprox).

    I hope this helps someone, for FREE :)

  7. Modernliving77
    Member
    Posted 8 months ago #

    Hi alucas2k

    I can't set directory. I saw your post so perhaps you can help me out? Read my post. "Email". Thanks in advance.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.