Showing posts with label Posts Tutorials. Show all posts
Showing posts with label Posts Tutorials. Show all posts

Sunday, January 22, 2012

How to Enable Threaded Comments in Customized Blogger-Blogspot Templates



Blogger-Blogspot has recently introduced much-awaited feature of threaded commenting. Now, users can reply to a comment and the comment owner will get an email notification. Naturally, I was also excited about it so, I enabled this feature on my heavily customized template. But it didn't work. I was lucky enough to have an old backup file of Simple Blogger-Blogspot template. After doing some coding, I found it quite easy to integrate the threaded comments in the Simple Blogger-Blogspot template. Please note that this is not a properly tested tutorial. Your template might have different codes. So, follow the steps carefully.


Note: This tutorial doesn't work for most of the people, so please email me your template. I'll manually edit and return to you in a week. Here is my email:
levisinside0@gmail.com


Steps to Enable Threaded Comments in Blogger-Blogspot


  1. First of all make sure that your blog feed is set to Full. You can confirm that by going to Settings > Other and then selecting Full from the Allow Blog Feed dropdown.
  2. You must also have embedded comment form enabled. Check that by going to Settings > Posts and Comments and check the Comment Location dropdown.
  3. After that, open the Template section.
  4. Blogger Updated Dashboard
  5. Warning: Backup your current template before moving on.
  6. Click the Edit HTML button.
  7. Blogger Edit HTML Button
  8. A new window will open. You'd have to click the Proceed button to start editing.
  9. Blogger Proceed Button
  10. Check Expand Widget Templates option.
  11. Find the following line of code:
    <b:includable id='postQuickEdit' var='post'>
  12. Once you've found the above line, you'll see this piece of code:
    </div>
    </div>
    </div>
    </b:includable>
    <b:includable id='postQuickEdit' var='post'>
    Now, we need to add some code just BEFORE the above code. The code to add is:
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    After adding the new code, overall code should look like this:
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    </div>
    </div>
    </div>
    </b:includable>
    <b:includable id='postQuickEdit' var='post'>
  13. Now, we need to find the following piece of code:
    <div class='post-outer'>
    <b:include data='post' name='post'/>
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <b:include data='post' name='comments'/>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:include data='post' name='comments'/>
    </b:if>
    </div>
    and REPLACE the above code with the following one:
    <div class='post-outer'>
    <b:include data='post' name='post'/>
    <b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    <b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:if cond='data:post.showThreadedComments'>
    <b:include data='post' name='threaded_comments'/>
    <b:else/>
    <b:include data='post' name='comments'/>
    </b:if>
    </b:if>
    </div>

  14. Click Save template and then Close button.





  15. Blogger-Blogspot Save Template Close Buttons
  16. Check your blog. If you can see the option of Reply under each comment then threaded commenting is enabled. Otherwise, upload your backup template.





Saturday, December 17, 2011

How to Change Post Title Background Color in Blogger-Blogspot Templates

A reader emailed me and asked about changing the post title background color, so here it is. In this tutorial I'll tell you how to change the post title background color in Blogspot templates. As usual, we'll do some editing in the template's HTML code and after that, you'll be able to change the post background color from Blogger Template Designer. So, here are the simple steps to follow:

Note: These instructions are according to the updated Blogger-Blogspot interface.

Steps to Change Post Title Background Color

  1. Open the Template section.
  2. Blogger Updated Dashboard
  3. Click the Edit HTML button.
  4. Blogger Edit HTML Button
  5. A new window will open. You'd have to click the Proceed button to start editing.
  6. Blogger Proceed Button
  7. Find the following code:
    /* Variable definitions
    ====================
    Replace the above code with the following one:
    /* Variable definitions
    ====================

    <Group description="Post Title Background Color" selector="h3.post-title">
    <Variable name="post.title.bg.color" description="Title Background Color" type="color" default="#222222" value="#eeeeee"/>
    <Variable name="post.title.bg.hover.color" description="Title Hover Background Color" type="color" default="#222222" value="#000000"/>
    </Group>
  8. Save your template and move on the next step.



  9. Now this step is a little different for each Blogger-Blogspot template. So, please follow the instruction according to the template you're using.

    1. For Simple Blogger-Blogspot template, find the following code:
      h3.post-title, .comments h4 {
      font: $(post.title.font);
      margin: .75em 0 0;
      }
      and replace it with the following one:
      h3.post-title, .comments h4 {
      font: $(post.title.font);
      margin: .75em 0 0;
      }

      h3.post-title a, h3.post-title a:visited { background:$(post.title.bg.color); }
      h3.post-title a:hover { background:$(post.title.bg.hover.color); }
    2. For Picture Window Blogger-Blogspot template, find the following code:
      h3.post-title {
      margin: 0;
      font: $(post.title.font);
      }
      and replace it with the following one:
      h3.post-title {
      margin: 0;
      font: $(post.title.font);
      }

      h3.post-title a, h3.post-title a:visited { background:$(post.title.bg.color); }
      h3.post-title a:hover { background:$(post.title.bg.hover.color); }
    3. For Awesome Inc & Ethereal Blogger-Blogspot templates, find the following code:
      h3.post-title, h4 {
      font: $(post.title.font);
      color: $(post.title.text.color);
      }
      and replace it with the following one:
      h3.post-title, h4 {
      font: $(post.title.font);
      color: $(post.title.text.color);
      }

      h3.post-title a, h3.post-title a:visited { background:$(post.title.bg.color); }
      h3.post-title a:hover { background:$(post.title.bg.hover.color); }
    4. For Watermark Blogger-Blogspot template, find the following code:
      h3.post-title {
      font: $(post.title.font);
      margin: 0;
      }
      and replace it with the following one:
      h3.post-title {
      font: $(post.title.font);
      margin: 0;
      }

      h3.post-title a, h3.post-title a:visited { background:$(post.title.bg.color); }
      h3.post-title a:hover { background:$(post.title.bg.hover.color); }
    5. For Travel Blogger-Blogspot template, find the following code:
      h3.post-title {
      margin-top: 20px;
      }
      and replace it with the following one:
      h3.post-title {
      margin-top: 20px;
      }

      h3.post-title a, h3.post-title a:visited { background:$(post.title.bg.color); }
      h3.post-title a:hover { background:$(post.title.bg.hover.color); }



  10. Coding is finished. Save your template.


Lets Change the Post Title Background Color in Template Designer

We've done the coding work. Now, you can simply open the Blogger-Blogspot Template Designer and customize the post title background color.
To open Template Designer, click Customize button. In Template Designer, select Advanced from the left menu. You'll see the Post Title Background Color option at the top. Here, you can preview your changes live. Please note that the change in Title Hover Background Color will not appear in Preview window. You can simply apply these changes to your blog and enjoy :)

Saturday, August 6, 2011

How To Change Post Title Color in Picture Window Blogspot Template

By default, there is no option to change post title color in Blogger Designer Templates. I've already written a tutorial to do that but users of Picture Window template are having problems. Here is a tutorial to change post title color in Picture Window template.

Note: If you're using other templates then see this tutorial:
Blogspot How To: Change Post Title Color in Blogger-Blogspot Template Designer Templates

Steps to Change Post Title Color in Picture Window Template


  1. Open the Template section.
  2. Blogger Updated Dashboard
  3. Click the Edit HTML button.
  4. Blogger Edit HTML Button
  5. A new window will open. You'd have to click the Proceed button to start editing.
  6. Blogger Proceed Button
  7. Find the following code:
       <Group description="Post Title" selector="h3.post-title, .comments h4">
    <Variable name="post.title.font" description="Title Font" type="font"
    default="normal normal 18px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 18px Arial, Tahoma, Helvetica, FreeSans, sans-serif"/>
    </Group>

    Tip: You can press 'Ctrl + f' keys or simply scroll down the HTML a bit to find the code.

  8. Replace the previous code with the following code:
       <Group description="Post Title" selector="h3.post-title, .comments h4">
    <Variable name="post.title.font" description="Title Font" type="font"
    default="normal normal 18px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 18px Arial, Tahoma, Helvetica, FreeSans, sans-serif"/>
    <Variable name="post.title.color" description="Color" type="color" default="#FE6602" value="#FE6602"/>
    <Variable name="post.title.hover.color" description="Hover Color" type="color" default="#FFD25F" value="#FFD25F"/>
    </Group>
  9. Now find this code:
    h3.post-title {
    margin: 0;
    font: $(post.title.font);
    }
  10. Replace the above code with this code:
    h3.post-title {
    margin: 0;
    font: $(post.title.font);
    color: $(post.title.color);
    }

    h3.post-title a {
    color: $(post.title.color);
    }

    h3.post-title a:hover {
    color: $(post.title.hover.color);
    }
  11. Click Save template and then Close button.
  12. Blogger Save Template Close Buttons
  13. Now go to Template Designer then Advanced and edit the Post Title option.


  14. You can simply edit the post color and post hover color from here.
  15. Enjoy!

Tuesday, February 8, 2011

Creating a Picture Link in Blogger Posts

Creating a Picture Link in Blogger Posts

You can also create picture link so that when a user clicks an image in your post, a new blog or a website will open. By default, when you upload a picture, it is linked to itself. For example, I've uploaded the following image, click it to see what happens:



So by default this image is linked to itself. If you've clicked it, you would have seen that same image is opened in the same tab. So, we'll change this image link.

Creating an Image Link in New Post Editor


To change the image link, please switch to the 'Edit HTML' tab of your post editor.



You'll see that there is no image there. Instead, there will be only code. Actually, this code is the HTML of our image. 'Compose' mode shows us the compiled HTML and 'Edit HTML' mode shows the raw HTML code. Anyways, now we'll do a little bit of editing.

This is the code for the above uploaded image.

<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s1600/1330057_flower.jpg" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="225" width="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s400/1330057_flower.jpg" /></a></div>


Please note that there will be 2 addresses or URLs in the uploaded image. For my image, these are the URLs.

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s1600/1330057_flower.jpg


&

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s400/1330057_flower.jpg


There is only 1 difference in the image URLs which is s1600 and s400. First URL with s1600 is actually the link URL. It is responsible for making this image a link. Second URL with s400 is the source URL. It displays the image.

As I've already told you that, by default, the image is linked to itself. So we need to change the first URL in our image code. For example, if I want to link the above uploaded image to my blog's homepage which is http://www.betatemplates.com/. I'll only replace my blog homepage URL with the first URL in the image code. After that, the image code will look something like this:

<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.betatemplates.com/" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="225" width="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s400/1330057_flower.jpg" /></a></div>

As you can see that I've only changed the first URL. Second URL is still an image. Now, if you'll click the following image, it will take you to my homepage.



Make Image Link Open in a New Window or Tab

If you're linking your image to some other blog or website then it is pretty desirable to make it open in a new window or tab. By doing this, visitors will stay on your blog.

To do this, I'll just add target="_blank" in the image code just after the link address. The code will look like this:

<div class="separator" style="clear: both; text-align: center;">
<a href="http://www.betatemplates.com/" target="_blank" imageanchor="1" style="margin-left:1em; margin-right:1em"><img border="0" height="225" width="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1UB7H1LJcUnxbVkjxCBKDOj1SvNIzd6hqu4A_h0byVFRIuz-B31xEyBCVDVSx4DTOHWZXfKC4mfLnMeLX3B-7tj7dnmUKCyA1Z6JDOSkRPHZ22rGkU3UCw2Uenna5xz3qOJ0BuUeyjAHl/s400/1330057_flower.jpg" /></a></div>


And the image will look same. However, now it will open in a new window or tab.

Sunday, February 6, 2011

How to Change Jump Break (Read More) Font, Color & Background Color in Blogger Template Designer



Blogger officially supports 'after the jump' summaries. You can insert a jump break anywhere in a post to make it short on the blog homepage. The part after the jump break will be visible only when user will click on the Jump Break or Read More link. In this tutorial, we'll add some coding in the template HTML. After that, you'd be able to change the font, color or even the background color of the Jump Break or Read More from the Template Designer.

Update!: This tutorial has been updated on 08/06-2012. Now, it can be applied to any default Blogger template without errors.

What is Jump Break or Read More Link?


If you don't know anything about Jump Break or Read More links, please read the following article in the official Blogger help.

Creating 'After the jump' summaries

Steps


Follow these simple steps to complete this Blogspot tutorial.
  1. Open the Template section.
  2. Blogger Updated Dashboard
  3. Click the Edit HTML button.
  4. Blogger Edit HTML Button
  5. A new window will open. You'd have to click the Proceed button to start editing.
  6. Blogger Proceed Button
  7. Scroll down a bit and you'll see this code:
    /* Variable definitions
    ====================
    Tip: Windows users can press 'Ctrl + f' to fing the code.
  8. Replace the above code with the following code:
    /* Variable definitions
    ====================

    <Group description="Read More" selector=".jump-link">
    <Variable name="readmore.font" description="Font" type="font"
    default="normal normal 12px Arial, Tahoma, Helvetica, FreeSans, sans-serif" value="normal normal 30px 'Courier New', Courier, FreeMono, monospace"/>
    <Variable name="rm.link.color" description="Link Color" type="color" default="#FFFFFF" value="#666666"/>
    <Variable name="rm.link.hover.color" description="Link Hover Color" type="color" default="#222222" value="#f5f5f5"/>
    </Group>

    <Group description="Read More Background" selector=".jump-link">
    <Variable name="rm.bg" description="Background Color" type="color" default="#00000" value="#222222"/>
    </Group>
  9. After that, find ]]></b:skin> and replace it with the following code:
    .jump-link { float: right; font: $(readmore.font); background: $(rm.bg); }
    .jump-link a, .jump-link a:visited { color: $(rm.link.color); }
    .jump-link a:hover { color: $(rm.link.hover.color); }
    ]]></b:skin>
  10. Now, save your template.
  11. After saving template, open the 'Template Designer'.
  12. In 'Template Designer', expand the Advanced tab and you'll see "Read More Link" tab at the top.


  13. You can change the font, color and background color and instantly see the preview. However, changes in hover link color will not be visible in the preview.
  14. After customizing the Jump Break or Read More link, click 'APPLY TO BLOG' link to save your changes.

Friday, February 4, 2011

Blogspot How To: Change Post Title Color in Blogger Template Designer Templates



I have received a lot of comments on a previous post. Readers are asking how to change the post title color in the new Blogger Template Designer templates. Well, here is a very simple step by step tutorial for you.We'll make some changes in the template CSS and then you'll be able to customize post title without any coding stuff.

Warning: Before making any changes, you must backup your existing layout:

Blogspot How to: Backup Your Blogger (Blogspot) Template

Steps to Make Post Title Font Customizable in the Blogger Template Designer Templates.


  1. Open the Template section.
  2. Blogger Updated Dashboard
  3. Click the Edit HTML button.
  4. Blogger Edit HTML Button
  5. A new window will open. You'd have to click the Proceed button to start editing.
  6. Blogger Proceed Button
  7. Find the following code:
    /* Variable definitions
    ====================
  8. REPLACE the above code with the following one:
    /* Variable definitions
    ====================

    <Group description="Post Title Color" selector="h3.post-title">
    <Variable name="post.title.link.color" description="Link Color" type="color" default="#ff0000" value="#ff0000"/>
    <Variable name="post.title.hover.color" description="Link Hover Color" type="color" default="#0000ff" value="#00ffff"/>
    <Variable name="post.title.color" description="Color on Post Page" type="color" default="#ff00ff" value="#ff00ff"/>
    </Group>

    Don't save or preview your template yet. Proceed to the next step.
  9. Now find this code:
    ]]></b:skin>
    and REPLACE it with the following one:
    h3.post-title { color:$(post.title.color); }
    h3.post-title a, h3.post-title a:visited { color:$(post.title.link.color); }
    h3.post-title a:hover { color:$(post.title.hover.color); }

    ]]></b:skin>
  10. Click the Preview button. You'll see the post title color as blue. Don't worry you can change it later in Blogger Template Designer. Save your template and click the Close button.

Hurray, Coding Done! Go & Customize the Post Title in Template Designer!


Simply click the Customize tab to open the Blogger Template Designer. Select Advanced from the left options. You'll see Post Title Color at the top.:


There are 3 options in the Post Title Color. Here is their detail:


Link Color: This is the color of the post title as a link. Any change to this option will appear in the Template Designer.


Link Hover Color: This color will appear when someone brings mouse over the post title. Any change to this option will not be visible in the Template Designer. You'd have to Apply the change, open the blog and bring your mouse over the post title to see the change in color.


Color on Post Page: This is the color of the post title on post page when post title is not a link. Again, you'd have to Apply the change and open some post title page to see the affect.


Help BetaTemplates!


If this tutorial was helpful then please add a link back to BetaTemplates on your blog. The link code is available at the bottom of this page.

Saturday, January 29, 2011

Blogspot How to: Add Adsense Below Post Titles

How to Add Adsense Below Post Titles in Blogspot Blogs


Google Adsense is the most popular ad network on the planet. A lot of Blogger users also use it. It's an endless discussion where to place these ads on your blog for maximum exposure. The best ad places are around the header or above the posts or below the post titles. You can easily add adsense in your sidebar as a gadget. But Blogger doesn't allows us to directly place the ads below post titles. The ads below post titles have proven to be one of the most successful money making positions. So, what are you waiting for? Follow this tutorial to add your Adsense ads below post titles.

Please Note: I'm assuming that you're using the new Adsense interface.


Steps!

  1. Log in to your Google Adsense account by going to https://www.google.com/adsense/
  2. Go to My ads tab and open Ad units from the left side by expanding Content link.[View Screenshot for Help]
  3. Click new ad unit to create a new ad.[View Screenshot for Help]
  4. Select the size, type and color of your ad. For best results chose either 300x250 medium or 336x250 large rectangle.[View Screenshot for Help]
  5. Give your ad a remember-able name and ad a custom channel to track the ad performance. If you don't know anything about channels then leave that option.
  6. After filling required information, click save and get code button at the bottom of the page.[View Screenshot for Help]
  7. A pop-up window will appear with the ad code. Copy that code.[View Screenshot for Help]
  8. Before pasting the ad code in Blogger, we must make it compatible with Blogger format. So go to http://www.hacktrix.com/adsense-code-converter/ paste the ad code and convert it. You'll find the converted ad code in the bottom box there. Copy the converted ad code.
  9. Open your Blogger account and go to Design then Edit HTML tab and check Expand Widget Templates option.
  10. Press Ctrl + f & find <data:post.body/> you'll see some code like this:
  11.     <div class='post-body entry-content'>
    <data:post.body/>
    <div style='clear: both;'/> <!-- clear for photos floats -->
    </div>
  12. Paste the converted ad code just before the above code. The result would look something like this:
  13. <script type="text/javascript"><!--
    google_ad_client = "ca-pub-xxxxxxxxxxxxxxx";
    /* my ads */
    google_ad_slot = "xxxxxxxxxx";
    google_ad_width = 300;
    google_ad_height = 250;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <div class='post-body entry-content'>
    <data:post.body/>
    <div style='clear: both;'/> <!-- clear for photos floats -->
    </div>
  14. Click the PREVIEW button to see the result. Thought you might not see ads below post titles instantly because sometimes Adsense ads take some time to display.
  15. After that save your template by clicking the SAVE TEMPLATE button.

Tip: Make Ads Appear Only on Post Pages


Usually, users don't like to see too many ads on a single page. So, we can hide the ads under post titles on main page. These ads will appear only when users will click the post title and go to the post page. To do that follow the steps above but after step 8 you have the converted ad code. Ad some more code in that converted code so that it should look like this:
<b:if cond='data:blog.pageType == &quot;item&quot;'><script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxxxxxxxx";
/* my ads */
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></b:if>

What I did here is that I've added an if condition to make the ads appear only on post pages. After that, follow the steps above to complete the tutorial.

Saturday, January 22, 2011

Blogspot Video Tutorial: How to Create a Post in Blogger

Hi guys, this is the 2nd part of my video tutorials series "Blogging for Beginners". In this part, I've explained how you can create a post on Blogger. Please watch this video and share it with your friends.



You can subscribe to my YouTube channel for further video updates:

http://www.youtube.com/user/BloggerEngineer

Friday, November 5, 2010

Blogspot How To: Center Post Title in New Blogger Templates

In this tutorial, I'll explain how you can change the alignment (position) of the post title. By default, post title aligns to left but you can change it to center as well. Currently, Blogger (Blogspot) offers 6 default templates in the Template Designer. This tutorial will work on all those templates.

Just open the Template tab -> Edit HTML button.

Then find (Ctrl + f) the following code:
]]></b:skin>

and REPLACE it with the following one:
h3.post-title { text-align:center; }

]]></b:skin>

Click the PREVIEW button and you'll see that the post title is now centered. After that save your template and enjoy :)

Help BetaTemplates!


You can help betatemplates.com by adding a link anywhere on your blog. The link code is available from the bottom of this page.

Wednesday, July 8, 2009

How to Change Post Body Font Size, Color & Style

You can customize post body font in any expect like color, size, style or family. First, you should know what is the default CSS code for post body and then we'll customize it according to our own taste. Go to Layout | Edit HTML and find this code:

The default code of posts!


.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
}

Understand the default code!


1- margin:.5em 0 1.5em; is defining spacing between post and other elements in the blog like sidebar and header.

2- border-bottom:1px dotted $bordercolor; it very descriptive. It creates a dotted border at the bottom of the post with width 1px.

3- padding-bottom:1.5em; causes some space between posts and other elements at the bottom. The other elements could be labels, comments or date.

Make changes in the default code!


Now, I've given you some idea about the post body style definitions. By default, the font properties are not defined specifically for posts but we can easily do this by applying some simple CSS techniques.

1- How to change font size in post body!

You need to add font-size:15px; property in the default CSS code:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
font-size:15px;
}

Tip: Try increasing or decreasing 15px to increase or decrease font size.

2- How to change font color in post body!

You need to add color:#FFFFFF; in the default definitions:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
color:#FFFFFF;
}

Tip: #FFFFFF is the hex code for white color, you can capture any color you see on your computer or on web and get the hex code of that color through a free utility ColorPic.

Remember: This property will not effect hyperlinks (?) in the post body, I'll tell you about hyperlinks customization later in this article.

3- How to change the font family in post body!

Font family means that you can control which font will be used to display post body. You can have Arial, Times New Roman, Georgia, Serif and many many more. So, you'll need to apply font-family:"Times New Roman",Georgia,Serif; property for this purpose.

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
font-family:"Times New Roman",Georgia,Serif;
}

Tip: I've added 3 fonts in font-family:"Times New Roman",Georgia,Serif; property, why? Because my user might not have Times New Roman installed on his/her computer then the second font Georgia will be used and similarly Serif can also be used.

Tip: See following article about CSS font family properties for information.

http://www.w3schools.com/css/pr_font_font-family.asp

4- How to change the style of post body font!

Remember: You might not need this property but this is useful for better understanding of your fonts.

By style, I mean you can make your font italic through font-style:italic; property.

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
font-style:italic;
}

Remember: If you'll not add this property in default definitions then your post body font will be displayed normal.

Tip: Blogger post editor provides an easy way to make specific part of text italic. When creating a post, select your text and click the i icon which is the second icon on toolbar.

How to apply these properties on hyperlinks in the post body!


Some of the above described properties will not effect hyperlinks (?) in the post body and there are no definitions in default Blogger CSS for hyperlinks (?) so lets add our own definitions.

This is the deafault code:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
}

Add some more juice in it:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
}
.post a {
color:#FF0000;
text-decoration:underline;
text-transform:uppercase;
}

Now, I'll explain all 3 properties added in .post a {} tag.

1- color:#FF0000; is the hex code for red color, you can hex code of some other color to change it.

2- text-decoration:underline; will make your post hyperlinks (?) underlined, you can change this to text-decoration:none; if you don't want to apply it.

3- text-transform:uppercase; will change your hyperlinks (?) to transform to uppercase. You can change it to text-transform:lowercase; if you want your hyperlinks to display in lowercase or you can change it to text-transform:none; to nullify this effect.

How to customize the hyperlinks for mouse over event (hover effect)!


You can also further customize the font appearance when mouse comes over your hyperlinks. For example you might want to change the color of your hyperlinks on mouse over or make it underlined or maybe change the font size.

This is our default CSS + hyperlinks CSS we added in the previous steps:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
}
.post a {
color:#FF0000;
text-decoration:underline;
text-transform:uppercase;
}

Add even more juice in it:

.post {
margin:.5em 0 1.5em;
border-bottom:1px dotted $bordercolor;
padding-bottom:1.5em;
}
.post a {
color:#FF0000;
text-decoration:underline;
text-transform:uppercase;
}

.post a:hover {
color:#0000FF;
text-decoration:none;
text-transform:lowercase;
}

Now, I'll explain some changes I've made.

Note: All the properties in .post a:hover {} will be visible only when you'll move mouse over the link.

1- The color will change to blue (#0000FF).

2- There will be no decoration of text. Previously, we applied text-decoration:underline; property to make our hyperlinks underlined but when mouse will come over, it will not be underlined.

3- On mouse over, our hyperlinks will become lowercase.

Tip: "On mouse over" is called "hover effect" in CSS references.

Before you leave!


I've tried my best to share my knowledge with you, if this article has really helped you then you can comment or tell other people about it through social networking. Any question, comment or suggestion will be greatly appreciated, thanks.