Support » Plugin: Livemesh Addons for Elementor » Change posts order of the post carousal

  • Resolved lasithhh

    (@lasithhh)


    Hi,
    Is it possible to order the posts of the carousal, relative to a meta field value.
    Thank you

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author livemesh

    (@livemesh)

    You can copy the template file –

    wp-content/plugins/addons-for-elementor/templates/addons/posts-carousel/loop.php

    to your theme folder

    mytheme/addons-for-elementor/addons/posts-carousel/loop.php

    and modify the query args at line number 14 to your needs. Pls see the below article for query arguments –

    https://developer.wordpress.org/reference/classes/wp_query/#custom-field-post-meta-parameters

    Hope this helps.

    Thread Starter lasithhh

    (@lasithhh)

    Hi Thank you.
    Can you please also help me with below.
    I am planning to add a ‘view more’ button as the last slide of the post carousal which will link to the category archive page. This category should be same as the one selected in the post carousal settings as the posts source (only one category is selected). Is it possible to get the selected taxonomy and it’s link to the loop-end.php template.
    I have tried below code but it did not output any values.

    <?php $taxonomies = array($settings[‘taxonomy_chosen’]);
    <div><php? echo $taxonomies[0] ?></div>
    ?>

    Plugin Author livemesh

    (@livemesh)

    Instead of making this link part of carousel and complicating the code, can you not just add a link below the carousel to the category page?

    Thread Starter lasithhh

    (@lasithhh)

    Hi,
    Client needs to add either a view more link at the end or make it auto load new posts when click on the navigation(something like load more on scroll). So I though it would be easy to add a view more link in the end.
    Please let me know if it is possible to get the taxonomy from an existing function, otherwise I will ad it as you suggested.
    Thanks

    Plugin Author livemesh

    (@livemesh)

    You should be able to get the taxonomy by using the below code in loop-end.php template –

     $taxonomies = $settings['taxonomies'];
      $terms = get_terms($taxonomies);
      $term =$terms[0];

    and then use API – https://developer.wordpress.org/reference/classes/wp_term/

    Thread Starter lasithhh

    (@lasithhh)

    Thank you very much for the support.

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