RSSAll Entries Tagged With: "wordpress"

How to Improve Site Speed in WordPress ?

WordPress is a very handy and useful platform for designing and operating websites. With such a wide range of plugins & themes WordPress can be used to make many different types of websites. However one issue that most WordPress users have to face is the problem of speed. I guess the saying you can’t have everything comes in play here, or can you?

We will start by highlighting the importance of site speed. Slow sites not only end up losing on users, since users obviously would prefer an alternative website which would load faster, but most search engines include site speed in their ranking algorithm. So your website will have
a lower search ranking as well.

Now, to speed up your site follow the following simple steps and your life is going to be a sea of sheer bliss-

1.  A good host however somewhat expensive is way better than a shared host. If you are planning on uploading viral content which you of course are, shared hosting will ensure that your content never goes viral. That slow speed is going to make users disappear.

2.  Always go for simpler themes. The default WP themes are usually the speediest options available. Their speediness maybe attributed to their
light framework.

3.  Some of the most useful plugins which you will come across WordPress are the caching plugins which help immensely in speeding up your
page load time.

4.  Content Delivery Networks (CDN’s) are your saviors since they take hold of your static files and serve them on a platter to the servers nearest to the visitors allowing them to download them at great

5.  Optimizing your WordPress database is a very simple but essential step of speeding up your site. You can do it manually or use a plugin like the WP-Optimize or WP-DB Manager plugin which will automatically do the optimization for you.

6.  Usually, when a visitor opens your websites, all the images on your homepage start loading. Since so many images are loading at the same
time, the images in the visitor’s browser window also appear to be loading, something which is sure to turn away visitors. You could, by using a simple plugin called the jQuery Image Lazy Load, ensure that only the images in the visitor’s browser window buffer first, effectively decreasing their load time. This process is known as LazyLoad.

7.  WordPress, being the reliable platform it is saves each and every draft you make till the end of time. You can reduce the number of drafts saved by WordPress to a reasonable amount by using the Revision

8.  Most of the themes have a typical PHP code which can very conveniently be replaced by some basic static HTML in order to increase your site speed time considerably.

9.  Off-loading content to an alternate server is a very effective way of decreasing server load. For example, if you want to upload some images to your blog, what you can do is upload them first on an image sharing site & then embed them on your page. This would mean that the images are being loaded on the servers of that image sharing site instead of yours, decreasing needless load and allowing you to gain precious speed.

Hope it helps ! 🙂

How to add “About the Author” Box in WordPress.

I had recently updated my blog theme and found that “about the author” box was missing at end of the post . I couldn’t find a good plugin to do the same but found a way to implement it manually .

This will require that you access 2 of your template files, however, very little coding is required.  Just copy and paste, unless you want to make further customization.

Step 1 : Edit single post page. [ single.php ]

Edit single.php [Single Post] page using appearance editor within your admin dashboard. Search for the <?php the_content(); ?> line of code, press enter to give some space then copy and paste the code below that line, then save :

[html]
<div>
<?php echo get_avatar( get_the_author_id() , 120 ); ?>
<h4>Article by <a href="<?php the_author_url(); ?>">
<?php the_author_firstname(); ?> <?php the_author_lastname(); ?></a></h4>
<p><?php the_author_firstname(); ?> has written <strong><?php the_author_posts(); ?></strong> awesome article(s) for us. <br/><br/><?php the_author_description(); ?></p>
</div>
[/html]

Step 2 : CSS file

Copy the CSS code below to your style.css or custom.css file. This will control the background color, width and text alignment. You may change the color schemes as needed to fit your theme.

[css]
<pre>/* Author’s Bio Box */
.postauthor { background: #F5F5F5; border-top: 1px solid #e1e1e0; border-bottom: 1px solid #e1e1e0; overflow: hidden; padding: 1.5em; }
.postauthor img { border: 5px solid #e2dede; float: left; margin-right: 1.5em; }
.postauthor h4 { color: #666; font-size: 2em; margin-bottom: 5px; }
.postauthor p { color: #515151; font-size: 13px; margin-bottom: 12px; }</pre>
[/css]

Step 3 : Author’s Bio

Add the author’s bio information in the About Yourself section in the wordpress dashboard.

Hope this tutorial was simple enough and very helpful !

Get the first image from a wordpress post and display it.

Hello friends , recently i came across some blogs that showed images under each post title on the index page . I needed to implement that in my blog , i found two methods to do it . Download a plugin named “Get The Image” and activate it or you can just copy paste the following code .

add the following code to functions.php

[php]
function catch_that_image() {
global $post, $posts;
$first_img = ”;
ob_start();
ob_end_clean();
$output = preg_match_all(‘/<img.+src=[\’"]([^\’"]+)[\’"].*>/i’, $post->post_content, $matches);
$first_img = $matches [1] [0];

if(empty($first_img)){ //Defines a default image
$first_img = "/images/default.jpg";
}
return $first_img;
}
[/php]

Once done, you can simply call the function within the loop to display the first image from the post.

[php]
echo catch_that_image() ;
[/php]

You are done !