phprockers-logo

How To Optimize Your Site With GZIP Compression

0 comments
Compression is a simple, the effective way to save bandwidth and speed up your sites. I hesitated when recommending gzip compression when speeding up your javascript because of problems in older browsers.

Most of my traffic comes from the modern browsers, and quite frankly, most of my users are fairly technology-savvy. I don't want to slow everyone else down because somebody is the chugging along on IE on Windows Operating Systems. Google and Yahoo browsers are using gzip compression.

Before we start, I should explain what content encoding is. When you request a file like http://www.gmail.com/index.html, your browser talks to a web server. 


How to get URL of first image in a post

1 comments

We can easily grab the first image from the post, and display it. 


// Get URL of first image in a post
function get_first_image() {
         global $post;
         $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)){
                  $first_image = "/images/default.jpg";
        }
        return $first_image;
}


<?php echo catch_that_image() ?>

How to write a WordPress Plugin?

0 comments
Before we move on coding a plugin, please make sure you remember the following coding practices.

1. Always you chose a unique name to your plugin so that it doesnt collide with names used in other plugins.

2. Make sure you comment wherever and whenever necessary in the code.

3. You will to test the plugin in your localhost (using xampp) along with latest version of wordpress.
Plugin Files & Names

What is mean by Wordpress?

0 comments
WordPress is not just a blogging platform and it is such a powerful CMS with unlimited capabilities, besides having a huge user base. Almost anything can be scripted with wordpress.

Customize your permalinks in wordpress

0 comments
%hour% – The hour of the time stamp of your post (1-24)
%minute% – The minute of the time stamp of your post (1-60)
%second% – The second of the time stamp of your post (1-60)
%category% – The category slug (wordpress-tutorials)
%author% – The author’s name (Leland)

Beauityful Short Story

0 comments
Little girl and her father were crossing a bridge.The father was kind of scared so he asked his little daughter,"Sweetheart, please hold my hand so that you don't fall into the river."The little girl said, "No, Dad. You hold my hand.""What's the difference?" Asked the puzzled father."There's a big difference," replied the little girl.
"If I hold your hand and something happens to me,chances are that I may let your hand go.But if you hold my hand, I know for sure that no matter what happens,you will never let my hand go." In any relationship, the essence of trust is not in its bind, but in its bond. So hold the hand of the person who loves you rather than expecting them to hold yours.....

what is CMS in php

0 comments
Content Management System (CMS) that provides you with the tools you need to easily create and manage your website. With tons of features and incredibly flexible. A Content Management System ( CMS ) is used to add, edit, and delete content on a website.