I am trying to separete products from posts in the search result. I can see the loop there search in both.

                        if( have_posts() ) {
                        while( have_posts() ) {

                            echo "<p><a href='". get_the_permalink() ."'>". get_the_title() ."</a></p>";
                    } else {
                        echo "<h4 class='text-center'>Sorry, no content to show...</h4>";

How can I create one loop form products and then another for post? If I try to include prodcut loop it ignores the search and displays all the products.

  • anyone please? I am searching but I cant find any answer. – Leandro Andrade Mar 27 '20 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.