[Resolved] How can i accomplish similar to this

Home Forums Support [Resolved] How can i accomplish similar to this

Home Forums Support How can i accomplish similar to this

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1380033
    Ashok

    I am wondering, if you could give me some clue on how to accomplish products table(usually 3 prouducts in a row) within a wordpress post. Pretty similar to following

    https://mashable.com/roundup/best-dating-sites/

    Thanks in advance

    #1380291
    David
    Staff
    Customer Support

    Hi there,

    when you say products – are you using Woocommerce ? If so you can use the shortcodes it provides to display a row of products:

    https://docs.woocommerce.com/document/woocommerce-shortcodes/

    For other post types use the WP Shows Posts plugin:

    https://wordpress.org/plugins/wp-show-posts/

    #1381363
    Ashok

    i am able to accomplish bit similar to that one, but have some obstuctions
    my website is regular wordpress without woocomerce.
    the 3 products in a row, are the 3 small posts which i wanted to show on each page like some featured products. If you go to this url, you will be able to see
    https://thedatingadvise.com/fuckbooknet-reviews/
    But those three small posts are also showing onto homepage, which i dont want. Any way to hide those?

    #1381492
    David
    Staff
    Customer Support

    You could add the posts to a specific Category and then add this PHP Snippet to exclude them from the main blog:

    add_action( 'pre_get_posts', function( $query ) {
        if ( $query->is_main_query() ) {
            $query->set( 'cat', -10 );
        }
    } );

    You just need change 10 to the ID of the category you’re wanting to exclude.

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