Default image or placeholder image for ad

Discussion in 'ClassiCraft WordPress Theme' started by themotorcycledude, Aug 5, 2013.

Thread Status:
Not open for further replies.
  1. themotorcycledude

    themotorcycledude Member

    Joined:
    Jul 11, 2013
    Messages:
    83
    Likes Received:
    0
    Hi,

    I posted an ad without any photos and noticed that there is no default photo or any placeholder, instead all of the text gets moved to the left. It doesn't look very nice. Is there any way to get a default image in there?

    Screen shot 2013-08-04 at 7.07.56 PM.png

    Thanks.
     
  2. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to admin > cc_functions.php present in your theme directory and add the code given below

    Code:
    else{
        $default_img = get_template_directory_uri().'/images/temp/sample1.png';
        print "<a href='#'><img src='".$default_img."' class='postimg $class' width='".$w."' height='".$h."' alt='Post Image'/></a>";
        }

    Sending image for reference

    2013-08-05_1407.png


    This will solve your issue.
     
  3. themotorcycledude

    themotorcycledude Member

    Joined:
    Jul 11, 2013
    Messages:
    83
    Likes Received:
    0
    Thanks, that almost worked.

    The correct code would be:

    else{
    $default_img = get_template_directory_uri().'/images/temp/sample1.png';
    print "<a href='$permalink'><img src='".$default_img."' class='postimg $class' width='".$w."' height='".$h."' alt='Post Image'/></a>";
    }


    I have another question regarding the same issue but in the detail page. I will add another post.
     
Thread Status:
Not open for further replies.

Share This Page