Removing "No listings found" message

This topic contains 3 replies, has 2 voices, and was last updated by  Kor 7 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #341958

    Benjamin Schmitz
    Expired Member
    Post count: 59

    Hi guys,

    Is there any way to remove the message “No listings found which match your selection.” for featured listings on location page if there are no featured listings for that area.

    What I mean is, if there are featured places to show – then show them, and if not – don’t show the widget at all. (Widget title “Featured places” and the message).

    Thanks

    #341973

    Kor
    Moderator
    Post count: 16516

    Hi Benjamin,

    This would require custom code to achieve what you needed there. Could you install the code snippets plugin and try the custom code below and see if it works?

    
    
    function customscript() {    
        ?>
        <script type="text/javascript">
          $(document).ready(function(){
    	$('#popular_post_view-1:has(.no-listing)').remove();
    	$('#popular_post_view-5:has(.no-listing)').remove();
    	});
        </script>
        <?php   
    }
    add_action( 'wp_footer', 'customscript' );

    Thanks!

    #342014

    Benjamin Schmitz
    Expired Member
    Post count: 59

    Kor Chung,
    That worked perfectly. Tested it both for the places and the events. Thanks you!!

    #342066

    Kor
    Moderator
    Post count: 16516

    Hi benjamin,

    Glad that worked. Enjoy GD and let us know if you need anything else.

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount