-
▼
2012
(336)
-
▼
June
(26)
- How to Remove Google Analytics Code From a WordPre...
- How to Add a Blogroll in WordPress
- How to Change Order of a Wordpress Header Menu
- How to Change WordPress Media Directories
- How to Use WordPress Tags in Clouds
- How to Wipe My Database of WordPress
- How to Monitor the Health of a WordPress Database
- How to Move a Calculator From PHP to WordPress
- How to Create an Anchor Link in WordPress
- How to Allow Others to Post to a WordPress Blog
- How to Change a WordPress Banner
- How to Integrate a Forum in WordPress
- How to Restore a WordPress Backup
- How to Change My WordPress Theme From My GoDaddy A...
- How to Make Your WordPress Site on an iPad
- How to Remove the 'Leave a Comment' Function on My...
- How to Widgetize the WordPress Body
- How to Move the WordPress Index.php From a Subdire...
- How to List Posts That Are Pending Review in WordP...
- How to Make a Three
- How to Remove and Reinstall WordPress
- How to List Story Tags in WordPress
- How to Change Text Color on the WordPress Blueberr...
- How to Reset Your Password for WordPress in MySQL
- How to Delete Home From WordPress
- How to Download E
-
▼
June
(26)
adsense
How to Widgetize the WordPress Body
1. Open your theme's template files in a code editor or Notepad. You need to edit every template where you want a widgetized body, so if you want to widgetize the body of the blog index and single post pages, then edit both index.php and single.php. Edit page.php if you want to widgetize static pages. Open the functions.php file for your theme as well.
2. Add the following code to your functions.php file:if(function_exists('register_sidebar')) {register_sidebar(array('name' => 'Body Widget Area','before_widget' => '
,'after_widget' => '
','before_title' => '
','after_title' => '
');}The above code checks that you can register sidebars and then registers a sidebar called 'Body Widget Area.' That is the name you will see on the 'Widgets' page in the WordPress dashboard. Wherever you place code to include this widgetized 'sidebar,' WordPress will add div tags with a class of 'body_widget.' Each widget title will get wrapped in the H3 tag.
3. Add the following code to any template file where you want a widgetized area to appear in the body of the page:
This if statement checks to see if the 'sidebar' exists or not. If it does not, it executes some fallback code. Place manual calls to widgets between the two lines of code to set your fallback. This code also places the 'sidebar' wherever you place it on the page.
4. Open the style.css file of your theme and add this code:.body_widget {width: XXpx;height: XXpx;}Replace 'XX' with the values you want, in pixels. Add any other CSS code you want for the div containing the widgetized area. The CSS code goes between the curly braces.
5. Upload your edited files to the appropriate theme file under /wp-content/themes/ on your server. Visit the wp-admin directory of your website and log in to the dashboard. Navigate to 'Widgets' and click the down arrow on 'Body Widget Area' to expand the 'sidebar' box. You can now drag and drop widgets in to the body's widgetized area, and they will appear in the body of your WordPress posts and pages.
6:58 AM | Filed Under | 0 Comments
Comments
Popular Posts
-
1. Log in to your Weebly account. 2. Click 'Theme Editor.' 3. Click on the 'Design' tab. 4. Select 'Edit CSS/HTM...
-
1. Sign up for a publisher account at Bidvertiser. Submit basic contact information and confirm your email address to get started. 2. Lo...
-
1. Log in to your WordPress dashboard. 2. Open the 'Appearance' section on the left side of the WordPress dashboard and then cli...
-
1. Open your WordPress Dashboard in your preferred browser. It is accessed at the '/wp-admin' location of your site. For example, ...
-
Facebook Widget 1. Create a Facebook fan page for your blog, if you don't already have one. You will have to manually share content wi...
-
1. Download and install the WordPress for BlackBerry app via BlackBerry App World. Download the version that corresponds with your BlackBe...
-
1. Go to your WordPress blog's administrative control panel. 2. Click the 'Settings' button on the left-side navigation menu...
-
1. Click the 'Add Contact' button on the 'Add New Post' page. This opens the 'Add a Contact Form' page. 2. Click...
-
1. Register an account with Amazon Web Services Cloud. If you have an existing Amazon account, enter your email address in the appropriate...
-
1. Log into your WordPress.com account using your user name and password. 2. Hover your cursor over the 'My Blogs' tab at the to...
Post a Comment