Showing posts with label Wordpress tips. Show all posts
Showing posts with label Wordpress tips. Show all posts

If you are using wordpress as you are new,more than likely all of the themes you are looking at using are widgetized. For that special occasion that your WordPress blog theme isn’t widgetized, here’s a simple way of how to hack your theme, and with just a little bit of code, you can widgetize your theme.

As official page from Automattic says:
Instead of register_sidebar() you should use register_sidebars(n) where n is the number of sidebars. Then place the appropriate number in the dynamic_sidebar() function, starting with 1. (There are several other ways to use these function. See the API). You can even give your sidebars names rather than numbers, which lets you maintain a different set of saved sidebars for each theme.





Now You can edit this in the functions.php file. If you don’t have a functions.php file, then you probably don’t have a widgetized theme. Here’s an example of some code that you could put in your functions.php file:

Step 1:-

Look for functions.php (Create one if you don’t have). Insert the following code into it, save and close. We are done with functions.php. Basically what this codes does is – it register the sidebar as dynamic.


<?php
if ( function_exists(‘register_sidebar’) )
register_sidebar();
?>


Step 2:-

Here’s how a typical sidebar.php will look like.

<div id="sidebar">
<h2>Search this site</h2>
<div id="searchdiv">
<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="s" id="s" size="20"/>
<input name="sbutt" type="submit" value="Go" alt="Submit" />
</form>
</div>
<h2><?php _e(‘Archives’); ?></h2>
<ul><?php wp_get_archives(‘type=monthly’); ?></ul>
<h2><?php _e(‘Categories’); ?></h2>
<ul><?php list_cats() ?></ul>
<h2><?php _e(‘Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><a href="<?php bloginfo(‘rss2_url’); ?>">RSS</a></li>
<li><?php wp_loginout(); ?></li>
</ul>
<?php wp_meta(); ?>
</div>


What you need to do here is to enclose an an-if statement into sidebar.php. The addition of codes are in bold.

<div id="sidebar">
<h2>Search this site</h2>
<div id="searchdiv">
<form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" name="s" id="s" size="20"/>
<input name="sbutt" type="submit" value="Go" alt="Submit" />
</form>
</div>
//
<?php if ( !function_exists(‘dynamic_sidebar’)
|| !dynamic_sidebar() ) : ?> // added
//
<h2><?php _e(‘Archives’); ?></h2>
<ul><?php wp_get_archives(‘type=monthly’); ?></ul>
<h2><?php _e(‘Categories’); ?></h2>
<ul><?php list_cats() ?></ul>
<h2><?php _e(‘Meta’); ?></h2>
<ul>
<?php wp_register(); ?>
<li><a href="<?php bloginfo(‘rss2_url’); ?>">RSS</a></li>
<li><?php wp_loginout(); ?></li>
</ul>
<?php wp_meta(); ?>
//
<?php endif; ?> // added
//
</div>


You are Done!!
Read More
After a lots of search i found a way to Installing WordPress 3.0 in Local Server.Because by installing wordpress in your local server.Its modify everything locally and then upload to the web server so that your visitor do no find any under construction materials or incomplete design of your blog.Testing plugins, themes etc.You may install it in your local server for experimenting purpose. After installing it in your local you can test your blog, how it would like to the visitor. Afterwords, you can upload to your web server. It will save your valuable bandwidth and internet connection bill.

Basic requirements:

PHP 4.3+
MySQL 4+ Database Server


Installing wordpress on your local server/computer


Step 1: Download the latest version of  wordpress here
Step 2: Now extract the download zip file.

Step 3: Now go to Cxamphtdocsyoursite and move all files and folders of wordpress to this folder.



Step 4: Now run apache and My SQL using XAMPP for windows or WAMP for windows or MAMP for Mac to create your computer a local server for wordpress environment. Otherwise you will not be able to run wordpress properly in your computer.

Step 5: Create a database for your blog. Go to phpMyAdmin writing http://localhost/phpmyadmin/ in internet browser’s address bar.




Note: Take note of the database details. After creating the database click on the “privilege” tab. Jotted down the following information:
Host: localhost
Database Name: testing
Username: root
Password:   (blank)

Step 6: Write down “ http://localhost/wp3/ “ in your address bar. The wordpress installation wizard will come. Click on “ Create a Configuration File


Step 7: Collect the following information of your database from step 5
  • · Database name
  • · Database username
  • · Database password
  • · Database host
Then click on “Let’s go!

Step 8: Now give the datatbase information as follows:
Database name: testing
Username: root
Password:
Database host: localhost
Table Prefix: wp_
Step 9: Then click on “Run the install” button.

Step 10: Now give the necessary information about your site. You can chose your own username and password. You may change your username from ‘Admin” to other name to keep safe your site from being hacked.



Step 11: You will see now a success message. Click “Log In” button.

Step 12: Log in to your dashboard using your username and password what you you have given during installation time.

You are done. Now check out your site at http://localhost/wp3


Step 3: Now go to Cxamphtdocsyoursite and move all files and folders of wordpress to this folder.



Step 4: Now run apache and My SQL using XAMPP for windows or WAMP for windows or MAMP for Mac to create your computer a local server for wordpress environment. Otherwise you will not be able to run wordpress properly in your computer.

Step 5: Create a database for your blog. Go to phpMyAdmin writing http://localhost/phpmyadmin/ in internet browser’s address bar.




Note: Take note of the database details. After creating the database click on the “privilege” tab. Jotted down the following information:
Host: localhost
Database Name: testing
Username: root
Password:   (blank)

Step 6: Write down “ http://localhost/wp3/ “ in your address bar. The wordpress installation wizard will come. Click on “ Create a Configuration File


Step 7: Collect the following information of your database from step 5
  • · Database name
  • · Database username
  • · Database password
  • · Database host
Then click on “Let’s go!

Step 8: Now give the datatbase information as follows:
Database name: testing
Username: root
Password:
Database host: localhost
Table Prefix: wp_
Step 9: Then click on “Run the install” button.

Step 10: Now give the necessary information about your site. You can chose your own username and password. You may change your username from ‘Admin” to other name to keep safe your site from being hacked.



Step 11: You will see now a success message. Click “Log In” button.

Step 12: Log in to your dashboard using your username and password what you you have given during installation time.

You are done. Now check out your site at http://localhost/wp3


Read More
Previous PostOlder Posts Home