How to add default image in blogger


#1

Is there any script to add default featured image in blogger like wordpress blogs. By default image I do not mean the facebook opengraph image but a image having scheme tags, which will remove Google Structured Data " image error’ when the blogpost does not have any image. Thanks


#2

@Deriklan

You have to enclose Rich snippets tags in Conditional Statements to show alternative image when there is no image available in post.

This will be little complicated, because blogger has some limitations with use of rich snippets tags.

No such script is currently available on internet.

If you need any other help, Then Ping Me Up.

Thanks,

Robin Singh


#3

You have followed any tutorial you might have pace the code for image url just replace the code with this code and replace YOUR_IMAGE_URL_HERE whit your default image

<div itemprop='image' itemscope='itemscope' itemtype='https://schema.org/ImageObject'>
   <b:if cond='data:post.firstImageUrl'>
    <img style='display:none;' expr:src='data:post.firstImageUrl'/>
     <meta itemprop='url' expr:content='data:post.firstImageUrl'/>
  </b:if>
<b:else/>
<img style='display:none;' alt='no image' class='post-image' src='YOUR_IMAGE_URL_HERE'/>
<meta itemprop='url' content='YOUR_IMAGE_URL_HERE'/>
    <meta itemprop='width' content='800'/>
    <meta itemprop='height' content='800'/>
</div>

Hope this may help you


#4

@flyraed

Thanks for providing this code here. Nice Share :yum:

@Deriklan

Use this code Buddy as suggested by @flyraed

Thanks,

Robin Singh