Classifier Default Image

Hi there!

Yesterday i got an e-mail from my friend Karrin from Georgia. He asked about Classifier theme archive page.

As you know, the archive page of Classifier theme will displaying all ads you have with the thumbnail. The problem now is:

If the ad doesn’t have any image attached on it, the layout will be bad

nothumbnail-screenshot

Classifier theme broken layout without thumbnail

For this problem, seems there is no permanent fix yet from the ColorLabs team. Then, i will tell you how to fix this problem by adding a default thumbnail.

Before you follow this tutorial, you can download the default image i want to use at this tutorial.

To do the modification, you can open and edit a file named taxonomy.php. Once you open the file, find out this code:

<?php colabs_image('key=image&width=296&height=174'); ?>

Modify that code become:

<?php
if ( has_post_thumbnail() ) {
	colabs_image('key=image&width=296&height=174');
} else {
	echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/non.png" />';
}
?>

Note:

Once you download the default image, you can rename that image to anything. At this tutorial, i name the image as non.png. Upload the image via FTP to directory: wp-content → themes → classifier → images.

And done! Right now if someone post an ad without any image on it, the default image will be displayed.

Advertisements

4 thoughts on “Classifier Default Image

    • hi, it should be like this:

      <?php
      if ( has_post_thumbnail() ) {
          colabs_image('key=image&width=296&height=174');
      } else {
          echo '<img src="' . get_bloginfo( 'stylesheet_directory' ) . '/images/non.png" />';
      }
      ?>
      

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s