• Resolved And1rzej

    (@and1rzej)


    Advanced Options for Adding Events to the Main Blog Loop

    I have done this install ?https://theeventscalendar.com/extensions/advanced-options-for-adding-events-to-the-main-blog-loop/

    then change this in settings?”?[ Sort order in blog loop ] – ?published”?When events are included in the main blog loop they will be sorted by this field.?”
    I want to have events in the main blog sorted by “published” order, but doesn’t work, they (events) still included in the main blog by their date, so what I was doing wrong?

    =>

    You can try temporarily reverting back to a default WordPress theme such as twenty-sixteen to see if that helps.

    RE – I did, but nothing has changed…

    =>

    Another thing you might want to try is to temporarily deactivate all other plugins to see if there is not a conflict at play.

    RE – I did, but nothing has changed…

    so may be should I put something <?php() ?> in “functions.php” or “index.php”?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi @and1rzej,

    Thanks for your interest in our products.

    You can try adding a snippet like this to your functions.php file:

    add_action( 'pre_get_posts', 'tribe_post_date_ordering', 51 );
    function tribe_post_date_ordering( $query ) {
    	if ( $query->tribe_is_multi_posttype) {
    		remove_filter( 'posts_fields', array( 'TribeEventsQuery', 'multi_type_posts_fields' ), 10, 2 );
    		$query->set( 'order', 'DESC' );
    	}
    }

    Take care,
    Ed ??

    Thread Starter And1rzej

    (@and1rzej)

    thank you so much for ur response

    I did, I add a snippet to “funcions.php” but still [Sort order in blog loop ] – ?published” – doesn’t work in loop

    Hey @and1rzej,

    Sorry that didn’t work for you!

    I actually had the same luck and upon updating to WordPress 4.9.6, the setting for event order disappeared. It seems that this snippet is pretty old, actually from 2014 — sorry for not checking that before passing it along.

    I’ll take a look at the script and see if it may be able to be revived.

    Take care,
    Ed ??

    Thread Starter And1rzej

    (@and1rzej)

    I’ll be waiting…

    I tested this again and the sort order option is working fine, so the issue s pointing towards your theme, more specifically the loop that is being used.

    If you temporarily activate an unmodified theme you’ll see that the extension is working as intended.

    Take care,
    Ed ??

    Thread Starter And1rzej

    (@and1rzej)

    Thank you so much for ur response and patientce

    (…) If you temporarily activate an unmodified theme you’ll see that the extension is working as intended.

    I did, (1)I deactivated my child theme to parent theme: [result:] doesn’t work, (2)and then child theme to twenty-sixteen [result:] but seriously still doesn’t work, what can I do now…?

    • This reply was modified 6 years, 6 months ago by And1rzej.
    • This reply was modified 6 years, 6 months ago by And1rzej.

    Sorry about the long wait on this one!

    Using that snippet that I posted, independent of the extension should get things going for you. It worked fine on 2 different sites for me.

    Changing from parent to child won’t help with anything — a newer theme may be a better bet.

    We’ve covered everything that could be hindering this ability — the only thing left is to craft a custom loop for your events and posts.

    Sorry I don’t have a better answer for you!

    Hey there,

    Since this thread has been inactive for a while, I’m going to go ahead and mark it as resolved. Don’t hesitate to create a new thread any time you help again!

    Ed ??

    I also have this issue, and none of suggestions have helped
    Regards,
    Garry

    Thread Starter And1rzej

    (@and1rzej)

    Hey there,

    Since this thread has been inactive for a while, I’m going to go ahead and mark it as resolved. Don’t hesitate to create a new thread any time you help again!

    Ed ??

    if possible take a look at my website may be I did something wrong?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[ Sort order in blog loop ] – ?published” – doesn’t work’ is closed to new replies.