Showing posts with label blog. Show all posts
Showing posts with label blog. Show all posts

Wordpress Plugin to Optimize Database and Cleaning Tasks

Apart from writing Good content for your blog, it is also very important do some housekeeping tasks, specially when you are managing the hosting environment yourself.  As traffic grows it also comes with spam and other unwanted things like fragmentation of database which may slow down the performance. Post revisions may pile up taking valuable resources in the database.

All these housekeeping tasks can be done easily with a single button click. WP-Optimize is a free plugin which can be used to optimize you database without going into technical details of queries and other kind of optimizations.

wp-optimize-plugin

Based on your selection it can remove post revisions, comments marked as spam, unapproved comments and Drafts. After cleaning it also displays a summary something like below.

wp-optimize-plugin2

And at last optimization done at the tables, showing number of KB space recovered.

wp-optimize-plugin3

For more details visit WP-Optimize plugin page at Wordpress.org

3 column, MagazineStyle, Adsense Ready blogger templates collection Part2

Another set of six Blogger Templates. You can get lots of free blogger templates with various styles and themes including most popular 3 column Templates, Adsense Templates from my Blog Templates gallery.

Reflection Blogger Template
BlackSplat Blogger Template
Online Magazine Blogger Template
  DfMarine Blogger Template
  Minima Full Widget Blogger Template
Magazine 3 Blogger Template

Blogger Trick : Applying Zebra Striping in Comments after each post.

An another idea to improve readability and visual appearance of comments section could be to apply Zebra Striping. In simple words Applying alternate colors.

To add Zebra Striping add the below Javascript : Include jQuery library. Add below line just before </head> section.
<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'></script>

Add below code to just before </body> section.

<script type="text/javascript">
$(document).ready(function() {
$("#comments-block dt").each(function(i){
      var divId='zpk' + i.toString();
      $(this).before("<div id='" + divId + "'></div>");
      $(this).next().next().prependTo("#" + divId);
      $(this).next().prependTo("#"  + divId);
      $(this).prependTo("#"  + divId);
      $("#" + divId).css("padding","10px");
       if(i%2==0){
        $("#" + divId).css("background-color","#cdd1f3");
       }else{
       $("#" + divId).css("background-color","#ffffff");
       }
 });
});
</script>

Related Posts:
Blogger Trick : Displaying post titles as summary on index pages
Blogger Trick : Adding numbering to comments after each post using jQuery
Blogger Trick : Make sidebar column height equal to the main content using jQuery

Blogger Trick : Displaying post titles as summary on index pages

One more idea that can enhance use experience on index pages is to display a summary of all titles on the page. This way user will not have to scroll though all the content on the page. He/She can directly jump to the title of their choice by hitting the navigation link.


Now .. to add the feature you simply need to add few lines of JavaScript  code just before </body> tag.

<script>
if($(".post-title >a ").length>1)
{
   $("#main-wrapper").prepend("<ol id='summary-list'></ol>");
   $("#summary-list").css("background-color","silver");
   $("#summary-list").css("list-style","none");
   $("#summary-list").css("padding","10px");
   $("#summary-list").css("margin","0px");
   $(".post-title >a ").each(function(i){
      var anchorname=$(this).parent().prev("a").get(0).name;
      $("#summary-list").append("<li><a href='#" + anchorname + "'>" + $(this).text() + "</a></li>");
    });
} </script>

And you need to include my favorite jQuery library at the top before </title> tag.
<script src='http://geekonweb.com/scripts/jquery-1.2.6.min.js' type='text/javascript'></script>

Thats it..  

Blogger Trick : Adding numbering to comments after each post using jQuery

Another pretty simple jQuery code to put more information on page.. the way we want.  What if I want to see numbering after or before each comments on my blog. Yes! solution is there and very easily achievable if you have idea about html layout of   Blogger.

In plain English the solution would translate to

1. Find the HTML Element with id="comments-block"

2. Find all DT Element inside it

3. Insert content of your choice. that's it.

and  the above solution in jQuery can be translated to :

<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'>
</script> <script type="text/javascript"> $(document).ready(function() { $("#comments-block").find("dt").each(function(i){ $(this).prepend("<span style='color:red;margin-right:2px;" + "padding:2px;background-color:silver'>" + (i+1).toString() + ".</span>" ); }); }); </script>

See the demo page with numbered comments here.

WOW jQuery is really great. Definitely the page doesn't looks great ..but the goal is achieved. I leave this creativity to readers. Please do post links of your creativity here.

Blogger Trick - Make sidebar column height equal to the main content using jQuery

With CSS based layouts it is a common problem that columns can not be made of equal height. By Googling you may find may ways to solve this. Here I am going to show you an easy solution to achieve this comparing to the solution given by "Amanda" in her article "How to make columns of equal height in Blogger".

Approach here is also the same but I am using jQuery to cut-short Javascript code.

Assuming we have two columns "main-wrapper" and "sidebar-wrapper" . Below line will simply assign the height of main-wrapper to sidebar-wrapper .. which simply we want.

<script src='http://code.jquery.com/jquery-latest.min.js' type='text/javascript'/> 
<script type='text/javascript'>
$().ready(function() {
   $('#sidebar-wrapper').height($('#main-wrapper').height());
});
</script >

To add this script fist identify the column-ids and paste just above </title> tag in html editor. If you are not sure how to check for id's you can use Firebug a very popular add-in for Firefox for the same. By just hovering specific HTML gets selected in it. See the image below:

See the live sample here

Google announces 30 new Themes for Gmail

Today google announced new themes feature for Gmail. Themes can be activated from settings - >Themes tab where you can choose from 30 different elegant Themes.  Google will be rolling out themes to everyone over the next couple of days, so if you don't see them yet, check back soon.

Find more details at Gmail Blog.

Google Translate widget for blogs/websites

By using a single line of script you can add Google Translate widget to you blog or website. Supported labguages are : Arabic, Bulgarian, Chinese (Simplified), Chinese (Traditional), Croatian, Czech, Danish, Dutch, English, Finnish, French, German, Greek, Hindi, Italian, Japanese, Korean, Norwegian, Polish, Portuguese, Romanian, Russian, Spanish and Swedish.
<script src="http://www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/translatemypage.xml &up_source_language=en&w=160&h=60&title=&border=&output=js"></script>
Google TranslateJust copy the above script and paste to the location where you want the widget to appear. If your page is not in English you need to change the value up_source_language=en to yours. If you are using blogger, go to layouts, add Javascrpt/HTML widget and paste the script there. For more details see google translate tools

Apture.com : Add Rich Media Experience to your blog/Website

Apture.com provides rich communication plateform that allows bloggers and publishers that can turn simple text pages of text into rich multimedia experience. It helps you find content, link it into your page, and display it inline — all with one line of code. Yourself you can see that the image and video link is available through Apture no markup was added for these two. Some of the strong features of Apture:

  • Multimedia Links : The service can add wealth of multimedia links to your site, opening content in new interactive windows that can be repositioned anywhere on the page, or enlarged to fullscreen.
  • Media Views : Apture supports multimedia content from around the web, be that images, documents, audio, video, news articles, movie information, product descriptions, music, podcasts…
  • Inline Multimedia Embedding : Apture also allows easy embedding of content into a page. You can resize the content to best match your page layout, and add a caption to introduce it.
  • AutoLink : Using Autolink feature you can convert all your existing links (Wikipedia articles, photos, and videos ) to Apture links, that would be better displayed with Apture.
  • Installation : You only need one line of code to bring the Apture experience to your website. Apture works with most popular publishing platforms and installs with just one click for Blogger and Typepad.
See more details through this video tutorial...