Showing posts with label wordpress. Show all posts
Showing posts with label wordpress. Show all posts

Sunday, March 30, 2008

complete workflow for transfering wordpress site to iis

this workflow assumes you are using the WP-DB-Backup plugin (I highly recommend) to backups of your mysql/wordpress db. Also am assuming that you use the mysql gui tools to interact with your desktop db (also highly recommended)

  1. do a database backup with WP-DB-Backup
    1. optional: save the archived .gz in your backups folder, nested inside a dated directory, and expand here ... you will need to expand this either way
    2. expand downloaded .gz if you didn't do it in 1.1
  2. download wp folder (or whatever the name of your root install is) via ftp
    1. optional: download this into your backups folder, nested inside a dated directory. Copy the wp directory to your inetpub folder
    2. if haven't already done so in 2.1, move wp directory into inetpub folder
    3. change permissions on this folder so that user has read/script execute permissions on all child objects
  3. open up mysql query browser
    1. make your wp schema default (or create one if you don't already have a schema for wp)
    2. next, file > open script > [browse to path of (expanded) .sql file saved with WP-DB-Backup]
    3. execute this query
    4. inside the wp_options change the following parameters to equal your new localhost install rather than the previous web install
      1. siteurl
      2. home
      3. any other options from plugins which have an external path defined

Sunday, March 16, 2008

Adding a 3rd sidebar

I've begun adding a 3rd sidebar to my theme as a first step towards figuring out how to add widgets outside of sidebars. While it took me an hour or two to figure this out, the solution is quite simple. This post helped a lot.

  1. Duplicate sidebar.php within your theme folder. This will become your new sidebar.
  2. Remove all code between the php if function_exists tags. Also remove all except one li block (having class=widget)
  3. So far your code might look like this:
    1. <div id="new_sidebar">
      <ul class="sidebar_list">
      <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1)) : ?>
      <li class="widget">
      <h2>Blah</h2>
      <ul>
      Blah Blah
      </ul>
      </li>
      <?php endif; ?>
      </ul>
      </div>

  4. Next you will need to change two parameters so that wordpress knows it is looking for 3 (or more) sidebars each with an id 1-3
    1. First you will need to change the id parameter of the dynamic_sidebar function on each sidebar.php file for example you can see that the dynamic_sidebar function below has a parameter of 1 ... thus this sidebar.php file should relate to sidebar id 1 ... each sidebar.php should have a different integer here from 1-3 (for three sidebars)

      1. <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar(1)) : ?>
    2. Next we will change the parameter of the register_sidebars function (which is normally in functions.php but may be elsewhere in your wp install) to 3 (since we have three sidebars to register)
      1. register_sidebars(3);