How can I change the placeholder for listings with no images?

Some­times, your list­ings might not have a gallery or sim­ple image assigned to them. In this case, the cards from the archive will be emp­ty, with noth­ing on them. This can be changed with a sim­ple piece of code. Just fol­low these steps:

Step 1 — Add the code to your website

Just copy this code in the functions.php file:

function replace_card_placeholder () {
	return 'image_link';
add_filter( 'listing_card_placeholer', 'replace_card_placeholder' );

Replace the image_link part with a link to the image you’d like to use as a place­hold­er.

If you don’t want to make changes inside the functions.php file, you can use the Code Snip­pets plu­g­in instead. This will do exact­ly the same thing for you.

This article applies to Listable, as they share the same underlying structure.

Updated on May 17, 2017

Was this article helpful?