• Resolved Andrea

    (@aneises)


    Hallo,
    ich würde gerne die Sortierung der Threads und/oder Posts ?ndern (von neu zu alt…). Habe gesucht (Einstellungen, im Forum auf der HP und hier), aber leider nichts gefunden.

    Hat jemand einen Tipp für mich?

    Grü?e, Andreas

    ___

    Hi
    I want to change the assorting of posts and/or threads from new first to old.
    Unfortunately I didnt′t found any setting.

    Any hint?

    Regards, Andreas

Viewing 4 replies - 1 through 4 (of 4 total)
  • Asgaros gave a decision, To do this you just have to add this code to your themes functions.php file:

    function custom_asgarosforum_filter_get_posts_order() {
    
    return 'p1.id DESC';
    
    }
    
    add_filter('asgarosforum_filter_get_posts_order', 'custom_asgarosforum_filter_get_posts_order');
    Thread Starter Andrea

    (@aneises)

    Hi Yworld,

    greats, thanks. That does the job for posts.

    In addition, I want to order threads by date (DESC).

    I′ve found another filter “asgarosforum_filter_get_threads_order” but the code

    function asgarosforum_sort_threads($order) {
    	$order = 't.name ASC';
    	return $order;
    }
    add_filter('asgarosforum_filter_get_threads_order', 'asgarosforum_sort_threads');

    sorts by name. Do you have a minute to explain, how to sort by date?

    “$order = ‘t.name ASC’;” -> $order = ‘date ASC”? I′m just getting familar with PHP, so please be forbearing ??

    Thanks in advance, Andreas

    • This reply was modified 8 years, 1 month ago by Andrea.
    Plugin Author Asgaros

    (@asgaros)

    Hello @aneises

    Please try the following snippet:

    function asgarosforum_sort_threads($order) {
    	$order = 't.id ASC';
    	return $order;
    }
    add_filter('asgarosforum_filter_get_threads_order', 'asgarosforum_sort_threads');

    Now topics should be ordered from: Old -> New

    I added a few more examples for this here:
    https://www.asgaros.de/support/?view=thread&id=41

    • This reply was modified 8 years, 1 month ago by Asgaros.
    Thread Starter Andrea

    (@aneises)

    Hi Asgaros

    Works like a charm. Thanks for your support (and your plugin, too!).

    Kind regards, Andreas

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Sortierung der Beitr?ge von neu nach alt’ is closed to new replies.