Home Forums Newsletter Plugin Support How can I change the order in which posts are displayed in emails?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #325560
    whitewavex
    Participant

    Hello.
    How can I change the order in which posts are displayed in emails?
    I need the older posts to be displayed first, and the latest ones at the end. How can I change the output order (block Blog Posts)?
    Thank you

    #325611
    Michael
    Keymaster

    Hello,

    at the moment we don’t have such an option. I’ve added this to our feature request list, which will be evaluated by our developers.

    Thanks for your feedback!

    Michael

    #325619
    whitewavex
    Participant

    If you would indicate in which file I can make changes to change the sequence, I would do it myself.
    Thanks

    #325696
    whitewavex
    Participant

    I am trying to adjust the sorting options in a file newsletter/email/blocks/posts/block.php

    $filters[‘order’] = ‘ASC’;
    $posts = Newsletter::instance()->get_posts($filters, $options[‘language’]);

    But it doesn’t work. Why?

    #325951
    Michael
    Keymaster

    Hello,

    that seems correct, I don’t know why it shouldn’t work in your case. However, unfortunately we do not provide support on custom code, sorry.

    Regards,
    Michael

    #325956
    whitewavex
    Participant

    Thanks. I will try to test it.

    #326279
    Anonymous
    Participant

    Hi Whitewavex,
    I have the same issue. Do you have resolved?

    #326287
    whitewavex
    Participant

    Hello
    Yes, I solved this problem.
    You need to add the following code to the plugins/newsletter/email/blocks/posts/block.php file:

    $posts = array_reverse($posts);

    Add this code before the block:

    if ($posts) {
    $out[‘subject’] = $posts[0]->post_title;
    }

    The array with posts will be reversed.

    #326289
    Anonymous
    Participant

    I have resolved starting from your code. Thank you!
    here you can find my customization to show custom order posts

    $filters[‘orderby’] =’menu_order’;
    $filters[‘order’] = ‘ASC’;

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.