change background for specific page and category in wordpress

WordPress tutorial, We will show how to change background for specific page and category in wordpress theme. achieve using conditional tags.

change background for specific page and category in wordpress

Many times clients demands for different background color or different images as a background. We can very easily achieve this using wordpress conditional tags.

change background for specific page and category in wordpress
change background for specific page and category in wordpress

You can use following code in your page.php or category.php file which is present in wordpress theme. If you want to change the background for specific page then open page.php file from theme folder.


<body <?php if(is_page('contact us'))&nbsp; echo 'class="contact_us"';?>>

Use following css code in your style.css file


.contact_us{

.background-color:#ccc;

}

.php_category{

.background-color:#181818;

}

If you want to use different background for your category then use following code.



<body <?php if(is_category('php''))&nbsp; echo  'class="php_category"';?>>

How to use multiple blogs in wordpress – multisite

Earlier wordpressmu was giving support for multisite support. Through this article, I will show you, How to use multiple blogs in wordpress – multisite.

use multiple blogs in wordpress – multisite

use multiple blogs in wordpress - multisite
use multiple blogs in wordpress – multisite

As we know wordpress 3.0 beta is released yesterday and as per wordpress team they merged the classic wordpress and wordpressMU.

But when we do installation of wordpress 3.0. There is no multiblog  facility available. For using the multiblog functionality we need to to some manual changes in code.

In this article I will tell you few steps about using the multiblog functionality in wordpress 3.0 beta.

First open the wp-config file and put following lines in that

define ('WP_ALLOW_MULTISITE', true  ) ;

Use following steps also
1 First, back up your exisiting wp-config.php and .htaccess files.

2. Create a blogs.dir directory under /wp-content/
This directory is used to stored uploaded media for your additional sites and must be writeable by the web server. They should be CHOWNed and CHMODed the same as your wp-content folder.

3. Add the extra lines provided to your wp-config.php file

These lines are dynamicly generated for you based on your configuration.

Put these lines right under the wp_allow_multisite line, mostly for readability.
Note: If you are installing in a folder the base and path will contain the folder name.

4. Replace the content of your .htaccess file with the following

(If there isn’t one, then create it.)

These lines are dynamicly generated for you based on your configuration.

5. Once the above steps are completed and the new wp-config.php & .htaccess files are saved, refresh your dashboard.
You will now see a new menu section called Super Admin. The menus contained in there are for adding and managing additional sites in your network. Your base WordPress install is now the main site in your network.

Now you can do the installtion of wordpress 3.0 beta and you are able to use multiblog functionality in wordpress 3.0

WordPress 3.0, Beta 1 is Released

This is really great news of yesterday. WordPress 3.0 beta is out for testing.

They merged the wordpress and wordpressMU in this version. There are so many major changes in UI and interfaces has been done.

WordPress 3.0, Beta 1 is Released
WordPress 3.0, Beta 1 is Released

You must know about this release

  • The custom menus system (Appearance > Menus) is not quite finished. In Beta 2, the layout will be different and a bunch of the functionality will be improved, but we didn’t want to hold things up for this one screen. You can play with making custom menus, and report bugs if you find them, but this is not how the final screen will look/work, so don’t get attached to it.
  • The merge! Yes, WordPress and WordPress MU have merged. This does not mean that you can suddenly start adding a bunch of new blogs from within your regular WordPress Dashboard. If you’re interested in testing the Super Admin stuff associated with multiple sites, you’ll need some simple directions to get started.
  • We’re still fiddling with a few small things in the UI, as we were focused on getting the more function-oriented code finished first. For example, we’re getting a new icon for the Super Admin section.

Best new thing in wordpress 3.0 beta

  • Play with the new default theme, Twenty Ten, including the custom background and header options.
  • Custom Post Type functionality has been beefed up. It’s really easy to add new types, so do that and see how it looks!
  • WordPress MU users should test the multiple sites functionality to make sure nothing broke during the merge.

You can download the wordpress 3.0 beta from here

Download wordpress 3.0 beta

  • Play with the new default theme, Twenty Ten, including the custom background and header options.
  • Custom Post Type functionality has been beefed up. It’s really easy to add new types, so do that and see how it looks!
  • WordPress MU users should test the multiple sites functionality to make sure nothing broke during the merge.

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.

Download wp bluemagic Free wordpress theme

We Created the professional blue color based wordpress theme. User can download wp-bluemagic wordpress theme form here.

Download wp bluemagic Free wordpress theme

wp-bluemagic

Download wp bluemagic Free wordpress theme
Download wp bluemagic Free wordpress theme

[viral-lock message=”Download and Demo Link is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

Demo | Download

[/viral-lock]

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 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.