How do you display random posts in Landing Page > Feature Boxes?

  • Author
    Posts
  • #76172

    Hi All, How do you display random posts in Landing Page > Feature Boxes?

    #76467

    Zed
    Cryout Creations Team

    The theme is designed to display the most recent posts (sorted descending by publish date).

    If you need some other order criteria (including random) you’d need to use the theme’s fluida_boxes_query_args filter to customize the query:

    add_filter( 'fluida_boxes_query_args', 'child_custom_boxes_order', 12, 2 );
    function child_custom_boxes_order( $args=array() ) {
        $custom_order = array(
            'orderby' => 'rand', 
            //'order' => 'DESC',
        );
        return array_merge( $args, $custom_order );
    } // child_custom_boxes_order()

    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
    #76603

    Thanks Zed … how would I go about implementing this?

    #76759

    Zed
    Cryout Creations Team

    You use that code in a child theme.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
Viewing 4 posts - 1 through 4 (of 4 total)

You need to log in to reply to this topic.