Separeting product from post in search result

Question

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() ) {
                            the_post();

                            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.

0
, , , Leandro Andrade 3 years 2020-03-25T12:50:59-05:00 0 Answers 115 views 0

Leave an answer

Browse
Browse