how to add a favicon to your wordpress site

In this tutorial we will show, how to add a favicon to your wordpress site, If you want to add the favicon image in your wordpress website that is really easy.

First use any photo editing tool like photoshop or gimp for creating the favicon image.

how to add a favicon to your wordpress site

how to add a favicon to your wordpress site
how to add a favicon to your wordpress site

To create the favicon image you should follow following rules

  1. By cropping or adding space around the image, make the image square.
  2. Resize the image to 16 x 16 pixels.
  3. Save the file as favicon.ico

Open your active wordpress theme and put favicon.ico image file in that folder or using ftp client you can put favicon.ico file in theme folder. After coping the favicon image file in theme folder. Open your header.php file from wordpress theme folder. and Put following code in that file.

 

 <link rel="shortcut icon" href="<?php bloginfo('template_directory'); ?>/favicon.ico" type="image/x-icon" />

Dont forget to put above code under head tag. Now your are set and changed the favicon from your wordpress site. To see the new favicon image you should clear your browser cache.

 

How to block your rss feed in wordpress website

In that situation you need to use following techniques. We given tricks, techniques and code for block your rss feed in wordpress website. Many people does not want to show their websites need to be cached or indexed by search engine. In that situation you need to use following techniques.

How to block your rss feed in wordpress website

How to block your rss feed in wordpress website
How to block your rss feed in wordpress website

First create the robots.txt file and put following code in that file.

User-agent: *

Disallow: /

You need to open functions.php file for disabling the rss feed from your website.
Put following code in that file.

function disable_rss_feed() {
    wp_die( __('No Rss feed are available,please visit our <a href="'. get_bloginfo('url') .'">website</a>!') );
}

add_action('do_feed', 'disable_rss_feed', 1);
add_action('do_feed_rdf', 'disable_rss_feed', 1);
add_action('do_feed_rss', 'disable_rss_feed', 1);
add_action('do_feed_rss2', 'disable_rss_feed', 1);
add_action('do_feed_atom', 'disable_rss_feed', 1);

wordpress 2.8.3 and 2.8.4 versions are under attack

If you are using the wordpress for your website or blog. Please do check your wordpress version because We got very serious news about wordpress older versions. I do got news about wordpress version 2.8.3 and 2.8.4. They are in serious trouble. There are so many sites are hacked and affected which is using wordpress 2.8.3 and 2.8.4 versions.

wordpress 2.8.3 and 2.8.4 versions are under attack

wordpress 2.8.3 and 2.8.4 versions are under attack
wordpress 2.8.3 and 2.8.4 versions are under attack

First I will tell you how can you check your wordpress website is hacked or not.

When you saw strange keywords in URL like  “eval” and “base64_decode.”

Check your Users in wordpress admin panel If you saw any new unwanted users then you really need to worry about.

Some time you did not able to access your wordpress admin panel. Then immediately take action and call your system admin or web development company.

I suggest first upgrade your wordpress version to greater than wordpress 2.8.6. I personally use the 2.8.6 and I did not found any issues yet.

Keep your admin passwords and database and ftp passwords as strong as possible.  Use special characters and numbers in password.

My personal suggestion is keep using the latest wordpress version.

how to pull sticky post from wordpress

From wordpress 2.7 version wordpress introduced the new feature called sticky post. Sticky post will give you ability to show the most popular or your favorite post always top of the posts.

how to pull sticky post from wordpress

how to pull sticky post from wordpress
how to pull sticky post from wordpress

Sticky post feature is very nice for wordpress theme developer. Here I will show you how to create sticky post in wordpress.

When you are creating the new post or editing the wordpress post you can choose the stick ths post option. This is very simple way to create the sticky post.

If you want to some good styling to post then use following css code. Just open your style.css file from your template.


.sticky {
 background: #ccc;
 border: 5px solid blue;
}

If you want to show the sticky post in any specific page then use following code.


is_page('sticky page') {
query_posts(array('post__in'=>get_option('sticky_posts')));
}
how to pull sticky post from wordpress
how to pull sticky post from wordpress

How to hide update message from wordpress admin panel

In this article, we given code and shown you. How to hide update message from wordpress admin panel. Some times Admin update message are interpreting on dashboard.

When new wordpress version came. we got a message in wordpress admin panel as follows:

WordPress ….. is available! Please update.

How to hide update message from wordpress admin panel

Many people does not want to see that message or hide this message from wordpress admin panel

How to hide update message from wordpress admin panel

Just Open functions.php file from wordpres theme and put following code in that file:


add_action('admin_menu','hide_update_message');
 function hide_update_message()
 {
 remove_action( 'admin_notices', 'update_nag', 3 );
remove_filter( 'update_footer', 'core_update_footer' );

}

This code will run in wordpress and wordpressMU also.

how to use robots.txt file in wordpress

Many person does not know importance of robots.txt file and how to use robots.txt file in wordpress. robots.txt file is important as per search engine.  The robots.txt file is very important as per search engine and SEO prospective.

how to use robots.txt file in wordpress

how to use robots.txt file in wordpress
how to use robots.txt file in wordpress

What is robots.txt file?

Robots.txt is a text (not html) file you put on your site to tell search robots which pages you would like them not to visit. Robots.txt is by no means mandatory for search engines but generally search engines obey what they are asked not to do.

In wordpress you should put robots.txt file. you can use following code in robots.txt file and put that file under your ROOT directory( wordpress main folder)

User-agent: *
Allow: /
Disallow: /*?s=
Disallow: /wp-admin/*
Disallow: /wp-content/*
Disallow: /wp-includes/*
Disallow: /wp-content/cache
Disallow: /wp-content/themes/*<code></code>
Disallow: /wp-content/plugins/*

Important Note: if you are using the QA or testing enviourment then put following lines in your theme header.php file. You can put the domain name condition also.

<?php
if($SERVER)['HTTP_HOST']=='Testing domain name') {
?>

<?php } ?>

You should not disallow the images and comments also because that is more important for SEO purpose. I recommend to use always good permalink structure for your wordpress installation.

how to register multiple sidebar in wordpress

Many wordpress developers and PHP developers who are new in to wordpress development. They really searching for how to add a dynamic or multiple side in wordpress theme. many sidebar or widget are very important to add in any wordpress theme for seo purpose also so you can add the widgets using our code sample.

register multiple sidebar in wordpress

Many wordpress developers got requirement to add separate sidebar for each page or any specific page and that sidebar need to be controlled by wordpress admin.

In this tutorial I will show you how to simply add the multiple or dynamic sidebar to wordpress theme. I really think creating the or putting separate css and options in  the sidebar and admin has no control over the sidebar.

Just use my code to create the multiple sidebar in wordpress theme. This following function is provided by wordpress api only. Open your functions.php file from your wordpress theme folder


<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
 if(function_exists('register_sidebar'))
 register_sidebar(array(
 'name' => 'Home Page', // The sidebar name you can choose as per your choice to register
 'before_widget' => 'PUT YOUR OPENING CSS DIV AND CSS CLASSES AND IDS HERE',
 'after_widget' => 'CLOSE THE DIV',
 'before_title' => '<h2>',
 'after_title' => '</h2>',
 ));
?>

This is sample code for multiple pages your can use following code:


<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
     // Home Page sidebar
     if(function_exists('register_sidebar'))
          register_sidebar(array(
          'name' => 'Home Page',
          'before_widget' => 'PUT YOUR OPENING CSS DIV AND CSS CLASSES AND IDS HERE',
          'after_widget' => 'CLOSE THE DIV',
          'before_title' => '<h3>',
          'after_title' => '</h3>',
     ));
     // Blog Page sidebar
     if(function_exists('register_sidebar'))
          register_sidebar(array(
          'name' => 'Blog Page',
          'before_widget' => 'PUT YOUR OPENING CSS DIV AND CSS CLASSES AND IDS HERE',
          'after_widget' => 'CLOSE THE DIV',
          'before_title' => '<h3>',
          'after_title' => '</h3>',
     ));
     // Contact us Page sidebar
     if(function_exists('register_sidebar'))
          register_sidebar(array(
          'name' => 'Contact Page',
          'before_widget' => 'PUT YOUR OPENING CSS DIV AND CSS CLASSES AND IDS HERE',
          'after_widget' => 'CLOSE THE DIV',
          'before_title' => '<h3>',
          'after_title' => '</h3>',
     ));
     // About us Page sidebar
     if(function_exists('register_sidebar'))
          register_sidebar(array(
          'name' => 'About us',
          'before_widget' => 'PUT YOUR OPENING CSS DIV AND CSS CLASSES AND IDS HERE',
          'after_widget' => 'CLOSE THE DIV',
          'before_title' => '<h3>',
          'after_title' => '</h3>',
     ));

?>

Here is Big question, How can you call the different sidebars and manage it. Go to wordpress admin and you will find and four side bars present in widgets sections as per this code. You can just drag and drop the widgets as your choice.

Open your sidebar.php file put following code in that file.

<?php
is_page('Home Page') {
     if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('Home Page')) :
     endif;
}
?>
how to register multiple sidebar in wordpress
how to register multiple sidebar in wordpress

You can use the following type of code in your sidebar.php file as per your condition. If you have any issues get back to me.

how to remove blog or category word from wordpress URL

Many times wordpress developer got requirement to remove the blog or category word from wordpress url. Code for remove blog or category word from wordpress.

how to remove blog or category word from wordpress URL

Many people and wordpress developer want to remove the blog or category wordpress from URL. This is really good for seo also. Many times wordpress developer got requirement to remove the blog or category word from wordpress url.

how to remove blog or category word from wordpress URL
how to remove blog or category word from wordpress URL

In this tutorial I will let you know how can you easily achieve this requirement. There is two-way to achieve this requirement. You can use the .htaccess file for fulfill this requirement.

Note: Apache mod_rewrite rule is must enable to with your Apache web server.

Open your .htaccess file which is present in your root folder of web hosting server. If not then create this file put it.

You can use the permanent redirect rewrite apache rule to achieve this. open your .htaccess file put following lines in that file


RewriteEngine On
RewriteBase /

#This rewrite rule we added for removing the category wordpress from URL
RewriteRule ^category/(.+)$ http://www.purabtech.in/files/$1 [R=301,L]

#This rewrite rule we added for removing the blog word wordpress from URL

RewriteRule ^blog/(.+)$ http://www.purabtech.in/files/$1 [R=301,L]

You can achieve this by changing in the code also. Use the following code do this changes. Open your theme folder and functions.php file and put following code in that file.


function remove_blog_word($without_blog_word_permalink)
{

if(!preg_match("/^\/blog\//",$without_blog_word_permalink))
return $without_blog_word_permalink;

$new_permalink=preg_replace ("/^\/blog\//","/",$without_blog_word_permalink );
return $new_permalink;

}

function remove_category_word($without_category_word_permalink)
 {

 if(!preg_match("/^\/category\//",$without_category_word_permalink))
 return $without_blog_word_permalink;

 $new_permalink=preg_replace  ("/^\/category\//","/",$without_category_word_permalink );
 return $new_permalink;

 }

add_filter("pre_update_option_permalink_structure","remove_blog_word");

add_filter("pre_update_option_permalink_structure","remove_category_word");

Just put above lines in your functions.php file and that will solve your issue.

how to pagination single post wordpress theme

If you are creating the bigger post then I recommend to in post pagination. Post pagination is supported by wordpress itself. Many people does not know about this facility of wordpress.

how to paginate the single wordpress post
how to paginate the single wordpress post

When you are writing the wordpress post just put <!–nextpage–> tag in your post. So from there next paragraph content will be show on next page but post will be same.

What is in post pagination?

WordPress tag similar to the more tag, except it can be used any number of times in a post, and each insert will “break” and paginate the post at that location. Hyperlinks to the paginated sections of the post are then generated in combination with the wp_link_pages() or link_pages() template tag.

If you are using the <!–nextpage–> tag in bigger post then wordpress post loading will more faster to your users.

Here I am going to tell you about <!–more–> tag also.  This tag is also very nice and good for showing some starting content of post.

What is more tag?

WordPress tag that breaks a post into “teaser” and content sections. Type a few paragraphs, insert this tag, then compose the rest of your post. On your blog’s home page you’ll see only those first paragraphs with a hyperlink ((more...)), which when followed displays the rest of the post’s content.

How to create user registration in wordpress

People want to use wordpress for simple website registration module and user management module. We have solution to create user registration in wordpress. There is User and registration module present in wordpress but only through wordpress admin panel.

create user registration in wordpress

But Client dont want to show the worpress admin module to normal user. They want to create user profile page which is matching with there wordpress theme or website.

In this article I will give the tip about how to create user and registration module in wordpress.

First download Theme my profile wordpress plugin from following URL:

Theme My Profile

create user registration in wordpress
create user registration in wordpress

This plugin allows you to theme a user’s profile based upon their role. It even includes custom roles if you have any.

Install this plugin to your wordpress and use only subscriber for using the theme profile. This plugin will create the user profile page page to your wordpress website.

Next step is download Theme my login wordpress plugin from following URL:

This plugin themes the WordPress login, registration and forgot password pages according to your current theme. It replaces the wp-login.php file by using a page template from your theme. Also includes a widget for sidebar login.

Activate this plugin and choose options as per your choice. Above plugins are very easy to use and you can customize plugins as per your choice also.

Next step is download Profile pic wordpress plugin from following URL:

  1. Profile Pic
create user registration in wordpress
create user registration in wordpress

This plugin allows authors to add a picture to their profile and helps automate the process of displaying author profiles

Using both plugin you can easily achieve the User and Registration, login, forgot password, profile edit, user photo upload etc… functionality.