Cannot see updates to WordPress website – sticky cache

Here’s how to clear your browser cache without going into your menus. This applies to Firefox, Internet Explorer, Safari and Chrome.

Note: CSS changes can cause a really sticky cache when background images are changed, they tend not to update unless you clear your cache.

Top 3 WordPress custom themes development systems or frameworks

When you customize WordPress pages and themes, it can be hard to remember what you’ve done a year or two later. That’s one reason why it’s good to use a WordPress development system or “Frameworks”. You don’t have to edit PHP, code like changing the functions.php to do things. Often you’ll find what you need in the theme/frameworks configuration screen.

A good WordPress backend has options to change page titles, use custom post types easily so that you can “target” various pages you want to customized without editing PHP.

This makes it so that you can see, your client can see, and you can more easily find your customizations later.

Another huge reason why is so that your WordPress theme updates don’t overwrite your custom WordPress pages so they don’t go away silently or worse yet…break your PHP code.

My top 3 WP frameworks are:

Genesis - good SEO for WordPress with page by page Meta Titles and tags. If you want to remove the WordPress H1 page title from the top of the page click here.

WooThemes - good modern WordPress themes with highly flexible options in the frameworks

RocketTheme - amazing themes and powerful plugins. To use the “Gantry” frameworks, which was created for Joomla, lots of it is done using widgets, however you’ll want a Gantry tutorial on positioning because these widgets are movable on a page using a unique system with sliders and number of widgets in a row. Gantry is using the standard 960px layout, and can be made fluid or liquid as well.

WordPress Auth_Key Secure_Auth_Key and Salt generator

This is an official WordPress secret auth key and secure auth key salt generator. Just click the link and it will make unique keys for your wp-config.php file.

https://api.wordpress.org/secret-key/1.1/salt/

If you reload the page or click this link again, you’ll get another unique WP salt. This is how to have your own WordPress salt that no one else has (likely).

Apache security – response headers – hide apache version

While this does fall into WordPress tips and tricks, it’s more of a WordPress security tip:

How to set: ServerSignature Off ServerTokens Prod

 

 

 

Paragraph spaces in WordPress editor – how to remove space between paragraphs

If you press and hold the “Shift” key while you hit the “Enter” key it the WordPress editor will give you the secret next line instead of the new paragraph!

If you simply hit the “Enter” or “Return” key on your keyboard it will create a new paragraph.

Reset your password in WordPress using PHPMyAdmin

from: http://codex.wordpress.org/Resetting_Your_Password

Reset your password in WordPress by PHPMyAdmin:

Begin by logging into phpMyAdmin and click databases.

Image #2

  • A list of databases will appear. Click your WordPress database.

Image #3

  • All the tables in your database will appear. If not, click Structure.
  • Look for wp_users.
  • Click on the icon for browse.
  • Locate your Username under user_login
  • Click edit

Image #4

  • Your user_id will be shown, click on Edit
  • Next to the user_pass is a long list of numbers and letters.
  • Select and delete these and type in your new password.
  • Type in the password you want to use. Just type it in normally, but remember, it is case-sensitive.
  • In this example, the new password will be ‘rabbitseatcarrots’
  • Once you have done that, click the dropdown menu indicated, and select MD5 from the menu.

Image #5

  • Check that your password is actually correct, and that MD5 is in the box.
  • Click the ‘Go’ button to the bottom right.
  • Test the new password on the login screen. If it doesn’t work, check that you’ve followed these instructions exactly.

Hide page titles in Wordpess using Genesis and a Child theme

How to hide your page titles by adding a function to your child theme’s functions.php file:

add_action('get_header', 'child_remove_page_titles');
function child_remove_page_titles() {
  if (is_front_page()) {
  remove_action('genesis_post_title', 'genesis_do_post_title');
  }
}

How to work with Genesis theme framework

NOTE: If you have made any changes directly to files in the /genesis/ folder, upgrading will overwrite these changes. Therefore, we recommend that you NEVER make changes this way. Alternatively, use the CSS in the child theme folder to make stylistic modifications, and use the proper PHP files in the child theme folder, along with the Genesis Hook system, to make functional/output modifications.

Contact Form 7 breaks after updating or upgrading WordPress to version 3

A client reported that WordPress with Contact Form 7 lost his contact form database after upgrading WP from version 2.x to version 3.

The author of Contact Form 7 has now updated his code so that the form is fully compatible with WP v3.

In case the upgrades don’t go smoothly:

I’d copy the actual contact form code into text files before upgrading WP. Then upgrade contact form 7, then see if they dissappear. In that case I’d paste them back in to the desired form from scratch an

Atahualpa tips and tricks

Here’s my tips for working with the very powerful theme Atahualpa.

Firstly this template is unlike most, it has your options in the WP backend Admin->Atahualpa Theme Options->here there are more than 100 options to set.  This generally does not require you to edit PHP files and FTP them to your server,  or edit CSS. This also doesn’t require Child Themes or additional template pages to create, specify and use.

To add google analytics website verification or webmaster tools verification to Atahualpa:

Admin->Atahualpa Theme Options->HTML Inserts: Header->Paste your google or ykey (yahoo key) in here.

A typical install of mine uses these CSS inserts in Admin->Add HTML/CSS Inserts:

ul.rMenu li a {width:148px; text-align:center;} /* custom menu centered */
li.cat-item {background-image: url(/wp-content/themes/atahualpa/images/bullets/Filagree_30px.gif);background-repeat: no-repeat; background-position: 0em;} /* custom menu icon */
h4 {margin:0.33em 0 -0.8em;} /* custom H4 */
td#middle a {color:red;} /* red links on page but only content area */
td#middle {border-left:1px ridge #FDF1CE;} /* ? */
div.widget_categories ul li a {margin-left: 19px;} /* using widget for categories as menu item – customized */
div.widget_categories ul li {margin-left: 5px; margin-bottom: 8px;} /* using widget for categories as menu item – customized */
div.widget_categories ul {margin-bottom: 35px;} /* using widget for categories as menu item – customized */
.post img.alignleft {float: left; margin: 0px 10px 5px 0;} /* atahualpa by default drops image down 10 pixels next to text, this overrides the setting in css.php for a 0px top margin site wide for left aligned image  */
.post img.alignright {float: right; margin: 0px 0 5px 10px; } /* same thing as above for right aligned image, this is from the atahualpa forum: http://forum.bytesforall.com/showthread.php?t=4416&highlight=alignleft  */
.post img.aligncenter {display: block;margin: 0px auto;} /* same thing as above for center aligned image  */

Plugins:

I am also using “Thumbnail  for Excerpts” which places the post’s first image as a thumbnail on the category, archive or other pages with post excerpts. If you do not have an image in the blog post, then you can explicitly specify one in the post excerpt.

“WP Events Calendar” doesn’t work for me with Atalhualpa, it does with other themes. It is possible this has been fixed or is a case of incompatibilities because I’ve not re-tried this on a default install.

To set the width of the top horizontal navigation menu and center it and the text menu items:
(in Atahualpa HTML/CSS Inserts)
ul.rMenu li a {width:148px; text-align:center;}

2 alternate ways to do the same thing from the Atahualpa forum:

http://forum.bytesforall.com/showthread.php?t=122

To add a background image to the horizontal menu bar, you have to set the height higher to see it from under the li items.
div#menu1 {background-image: url(/wp-content/themes/atahualpa/images/header/banner_964px.gif);}

To remove the “< Previous Post” “Next Post >” links at the top or the bottom of your post pages:
Admin->Atahualpa Theme Options->Next/Previous Navigation->Location of Next/Previous Page Navigation on MULTI Post Pages->set it to “None”
Admin->Atahualpa Theme Options->Next/Previous Navigation->Location of Next/Previous Page Navigation on SINGLE Post Pages->set it to “None”

To show different category listings and indent them as a navigation menu:
from the Atahualpa forum and the master himself…Flynn : http://forum.bytesforall.com/showthread.php?t=2373

To indent sub items set check the “Show Hierarchy” checkbox inside the Category widget

You can use the default Categories widget multiple times but it will always display all categories.

To display several instances showing different categories, install and use multiple instances of the PHP code widget, drop a few of them into the sidebar, click on their Edit links to give each one a title, such as “Party Themes”, and put this into each one

<ul>
<?php wp_list_categories(‘show_count=1&title_li=&include =3,7,22‘); ?>
</ul>

3,7,22 means display posts of categories with the ID’s 3, 7 and 22.

Put the numbers in ascending order here. Look up the ID’s of categories at WP Admin -> Posts -> Categories -> Edit -> Watch browser status bar at bottom of browser window for “…&cat_ID=XX


Posted in Wordpress Tips. 19 Comments »

Paragraph spaces in WordPress editor – how to make space between paragraphs

To create paragraph spaces in TinyMCE or <p> </p> tinymce wordpress:

A WordPress style is <p><br “class=spacer_” /></p>, however this is not in my stylesheet,  it comes from using TinyMCE advanced as an editor plugin in the backend.

A quick way to do it is:

<p>&nbsp;</p>

but this will give full line height spaces between paragraphs.

I use this instead because I can adjust the line-height, thus distance between the paragraphs:

In the code:

<p class="spacer">&nbsp;</p>

In the stylesheet:

.spacer {
 line-height: 0.7em;
}

WordPress How to Tell if a Page is Loaded

If you would like to do something special on a page with code and know if it’s not a post, you can use a conditional test to find out if a page is loaded:

<?php if (!is_page()) {do this} ?>
Posted in Wordpress Tips. No Comments »

Linking to any page, post or category in wordpress

If you cannot link to a page you added properly, plugin “page links to” will do it. Install and edit page, don’t worry about the “permalink” at the top, scroll to the bottom and create your link. In my case I needed a category page and wordpress’ “Permalink” editor strips out index.php?cat=7 links and /category/my-category links when you try to add them. (it parses out the ? and the /)

from the wordpress codex: http://codex.wordpress.org/Linking_Posts_Pages_and_Categories

There are two ways to make internal links from one content page to another in WordPress. One uses permalinks and one does not. The method that does not use permalinks works regardless of whether permalinks are enabled for your site.

Contents

[hide]

Linking Without Using Permalinks

If you are not using Permalinks, how do you link to your pages, posts, and categories?

Using the numeric values found in the ID column of the Posts, Categories, and Pages Administration, you can create links as follows.

Posts

To link to a Post, find the ID of the target post on the Posts administration panel, and insert it in place of the ’123′ in this link:

<a href="index.php?p=123">Post Title</a>

Categories

To link to a Category, find the ID of the target Category on the Categories administration panel, and insert it in place of the ’7′ in this link:

<a href="index.php?cat=7">Category Title</a>

Pages

To link to a Page, find the ID of the target Page on the Pages administration panel, and insert it in place of the ’42′ in this link:

<a href="index.php?page_id=42">Page title</a>

Date-based Archives

  • Year: <a href=”index.php?m=2006″>2006</a>
  • Month: <a href=”index.php?m=200601″>Jan 2006</a>
  • Day: <a href=”index.php?m=20060101″>Jan 1, 2006</a>

Links On External Sites

If you are providing a link to your site from outside of your site, be sure to specify a full URL to the correct location:

<a href="http://example.com/index.php?p=123">post title</a>

If you have installed WordPress to a subfolder, such as wordpress, don’t forget to add the folder to the link URL:

<a href="http://example.com/wordpress/index.php?p=123">post title</a>

Linking Using Permalinks

If you are using permalinks, you can use all of the above non-permalink techniques, which will work with permalinks enabled or not. If you have enabled permalinks, you have a few additional options for providing links that readers of your site will find a bit more user-friendly than the cryptic numbers.

The complexity of the URL depends on the complexity of your permalink configuration. If your permalink configuration (set on the Options > Permalinks Administration Panel) contains many Structure Tags, then the URL will be more difficult to construct.

Posts

For posts, replace each Structure Tag in your permalink structure with the data appropriate to a post to construct a URL for that post. For example, if the permalink structure is:

/index.php/archives/%year%/%monthnum%/%day%/%postname%/

Replacing the Structure Tags with appropriate values may produce a URL that looks like this:

<a href="/index.php/archives/2005/04/22/my-sample-post/">My Sample Post</a>

To obtain an accurate URL for a post it may be easier to navigate to the post within the WordPress blog and then copy the URL from one of the blog links that WordPress generates.

Review the information at Using Permalinks for more details on constructing URLs for individual posts.

Categories

To produce a link to a Category using permalinks, obtain the Category Base value from the Options > Permalinks Administration Panel, and append the category name to the end.

For example, to link to the category “testing” when the Category Base is “/index.php/categories”, use the following link:

<a href="/index.php/categories/testing/">category link</a>

You can specify a link to a subcategory by using the subcategory directly (as above), or by specifying all parent categories before the category in the URL, like this:

<a href="/index.php/categories/parent_category/sub_category/">subcategory link</a>

Pages

Pages have a hierarchy like Categories, and can have parents. If a Page is at the root level of the hierarchy, you can specify just the Page’s “page slug” after the static part of your permalink structure:

<a href="/index.php/a-test-page">a test page</a>

Once again, the best way to verify that this is the correct URL is to navigate to the target Page on the blog and compare the URL to the one you want to use in the link.

Date-based Archives

  • Year: <a href=”/index.php/archives/2006″>2006</a>
  • Month: <a href=”/index.php/archives/2006/01/”>Jan 2006</a>
  • Day: <a href=”/index.php/archives/2006/01/01/”>Jan 1, 2006</a>

Links on External Sites

Permalink structures should begin with a slash, meaning that they are anchored at the root of the site’s URL. You should be able to prepent the protocol and server name to any link that begins with a slash to build a successful full URL.

For example, this category link:

<a href="/index.php/categories/parent_category/sub_category/">subcategory link</a>

Becomes this category link using a full URL:

<a href="http://example.com/index.php/categories/parent_category/sub_category/">subcategory link</a>

Combining Links with Template Tags

You can customize your links in the header, footer, or sidebar to be combinations of link types. This example features links to two categories, the main index page, a post, a static page, and uses the Pages template tag.

Note carefully that the wp_list_pages() template tag generates its own List Item (LI) so it doesn’t need to be wrapped in a LI tag. This template tag is also set to list only the parent Pages and not their subPages or “children”.

<ul id="linklist">
 <li>
  <?php _e('Check It Out'); ?>
  <ul id="pageslist">
   <li>
    <a title="Home Page" href="index.php">Home</a>
   </li>
   <li>
    <a title="Blog" href="index.php?cat=7">Blog</a>
   </li>
   <li>
    <a title="Life Story" href="index.php?p=12">My Life Story</a>
   </li>
   <?php wp_list_pages('exclude=4&depth=1&sort_column=menu_order&title_li='); ?>
   <li>
    <a title="Links and Resources" href="index.php?cat=33">Links</a>
   </li>
   <li>
    <a title="Site Map" href="sitemap.php">Site Map</a>
   </li>
  </ul>
 </li>
</ul>

Using such a customized list, you can also add CSS classes to change the look of each of the links, or style the entire section. It’s up to you.

Absolute versus Relative Links

Absolute links define absolutely where to find the target of the link.
Relative links define the location of another document in relation to the current document.

Absolute Link Examples

Full URIs of the form http://example.com/wordpress/index.php are absolute links.

Absolute links can also point to your own server. When doing so, you may safely omit the http://domain.com prefix, and link to the target with a full path:

/wordpress/index.php

The leading slash means “At the very top of this domain is a directory named wordpress, and inside this directory is a file named index.php“.

A document at

http://example.com/wordpress/index.php

contains a link of the form

/wordpress/index.php

The link above, when clicked, will take the viewer to

http://example.com/wordpress/index.php

Relative Link Examples

Relative links do not start with a slash:

wordpress/index.php

The lack of a leading slash means “Inside the current directory is a sub-directory named wordpress, and inside that directory is a file named index.php“.

A document at

http://example.com/wordpress/index.php

contains a link of the form

wordpress/index.php

The link above, when clicked, will take the viewer to

http://example.com/wordpress/wordpress/index.php

Let us consider the case where in our blog where we are editing

http://example.org/blog/2009/01/04/nurds-on-the-loose

From it we can make links

  1. <a href=”../01/happy-new-year”>New Years Announcement</a>
  2. <a href=”../../01/01/happy-new-year”>New Years Announcement</a>
  3. <a href=”../../../2009/01/01/happy-new-year”>New Year’s Announcement</a>
  4. <a href=”../../../2008/12/25/merry-christmas”>Christmas Announcement</a>

Note 1, 2, and 3 are all valid to achieve the same link. However with 4 there is no shortcut, as we must “climb” all the way into the previous year.

The links are all relative and we need not hardwire in any more knowledge than is necessary, which also will help portability if one day we export the blog elsewhere. (What happens if one day we however pick a different permalink structure via the administration panels is unknown…)

However, the above assumes we are always viewing a single post. If in fact we are viewing that same post in an archive, well, then all our assumptions of where we are now are wrong! So we see that however smart relative linking looks, it has a fatal flaw and cannot be chosen!

For more information on absolute and relative links, see the WebReference Tutorial on Absolute and Relative Links.

Dynamic Linking in Templates

Whether you use permalinks or not, in templates you can link to pages or posts dynamically by referring to its unique numerical ID (seen in several pages in the admin interface) with <a href="<?php echo get_permalink(ID); ?>">This is a link</a>. (as shown in Template_Tags/get_permalink)

This is a convenient way to create page menus as you can later change page slugs without breaking links, as IDs will stay the same. However, this might increase database queries.

Dynamic page menus can also be created by utilizing Template_Tags/wp_list_pages child_of parameter or some of the many available plugins.

RSS

It seems that only fully qualified links (http:…) are guaranteed to work in all RSS reading environments…

Resources

Posted in Wordpress Tips. 2 Comments »

Worpdress How to show the last 5 posts

Show the last 5 posts or whatever number you specify using the following code, it loops through all of the posts.

First method I devised:

              <ul id="recent-items">
              <?php
                  $recentPosts = new WP_Query();
                  $recentPosts->query('showposts=10');
              ?>
<!--t added set the incremental counter<=? to the number of recent posts you want to see-->
              <?php $counter = 1; while ($recentPosts->have_posts() && $counter <= 10) : $recentPosts->the_post(); ?>
                  <a class="archive-content_footer" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?> - <?php the_date(); ?></a>
                  <?php // the_excerpt() ?>
                  <?php $counter++ ?>
                  <p>&nbsp;</p>
                  <hr>
              <?php endwhile; ?>
               </ul>

Second method officially shown on the wordpress codex (however the_date() didn’t work with this for some reason):

              <ul id="recent-items">
             <?php
             global $post;
             $myposts = get_posts('numberposts=5');
             foreach($myposts as $post) :
             ?>
    <div id="posttitle"><a href="<?php the_permalink(); ?>"><?php the_title(); ?><?php the_date('Y-m-d', '<h3>', '</h3>'); ?></a></div>
 <?php endforeach; ?>
 </ul>
Posted in Wordpress Tips. No Comments »

Which pages are based on what templates in WordPress?

This depends upon your specific template. Custom page and post templates can be defined merely by putting them up on the website in the Theme’s folder with the title “content.php” which overrides wp-content.php.

The Default Template for my Blog pages is “Single.php” based on the inove template.

A new template can be created for pages (not posts) by creating it (or copying the code from something like “archive.php”, uploading it to the server and then selecting it in the dropdown menu “Template” on the page edit screen. This can be done for posts if you use the plugin “Custom Post Templates”.

Contact Form 7 – Thank You page after submit

WordPress’ wonderful plugin Contact Form 7 has not supported loading a Thank You page after the user clicks Submit. (As of Aug. 2009)

Here is a way to force Contact Form 7 to load a custom page after the user submits the form:
(note that it will change the submit form results for every contact form on the website, until code is added to the javascript to handle multiple Contact Forms on one WordPress website)

Edit this file: /wp-content/plugins/contact-form-7/contact-form-7.js
line: 91 add one line here, immediately after the code:

    if (1 == data.mailSent) {

add this:

location.href="http://mywebsite/my-thank-you-page/";

My favorite WordPress Plugins

Contact Form 7 – Super easy and functional contact form for website email.
Tip: You can run more than one form and customize each by creating a new one and referencing the appropriate one from the page you want the form on.

Gravity Forms – This is the hopped up version of Contact Form, it can dynamically populate your contact form, it can send your submissions to your newsletter server and more.

akismet – Stock plugin with WP, you have to create an account on wordpress.com to get an API Key then go  back to your  self hosted WP and install that key to get it to work. You can get fancy and use it to update status upon submitting a comment using AJAX.

ArtPal
Tips: Won’t work on WordPress MU (6-2009),  also had problems on Bluehost but don’t know why yet. Otherwise, I love this plugin thanks freerobby.com!

google sitemap generator – Creates sitemap.xml every time you add to your blog and submits to Tier 1 search engines.

NextGEN Gallery
Tips: Use instead of the recommended

to get started, that worked for me. Another possible bug, after installing on WP 2.8 beta 2, the gallery was working but quit for some reason. I’ll  update to WordPress 2.8 on June 10, the day the final release comes out and maybe look at this issue again.

TinyMCE Advanced
Tips: Go to Admin->Settings->TinyMCEAdvanced and drag your toolbuttons to and from the toolbar,  I allow it to not strip <br> and <p> tags added manually into the HTML editor.

SEO Title Tag

Posted in Wordpress Tips. No Comments »

WordPress Plugin Compatibility checker

Here’s a great WP website that has a compatibility chart of various plugins with various versions of WordPress:
WordPress Plugin Compatibility Check

Using custom styles in WordPress and tinyMCE

You can use the kitchen sink editor and have your styles appear in the “Styles” drop down directly in the page editor.

http://www.laptoptips.ca/projects/tinymce-advanced/

After you install the plugin, it’ll put a new button on the wp admin toolbar where you can configure stuff. Drag the new ‘styles’ dropdown to the tinymce toolbar, add new styles to the css file in the plugin directory, Ctrl + F5 to get everything to reload, and there you have it. If the style does not show up, dump your browser cache, then reload.

To Hide or unlink pages from the main menu in WordPress

To hide a page or post from the navigation menu in WordPress do this usually in your theme’s sidebar.php or header.php if you are using pages on your menu. Note: most people are not using pages, posts are default for the navigation menu:

<ul>
<li><a href="<?php bloginfo('url'); ?>">Home</a></li>
<?php wp_list_pages('title_li=&depth=1&exclude=8'); ?>
</ul>

Really, the key part is "&exclude=8", find the page you want to hide or unlink from the menu by clicking on it and reading the location in the URL bar up top in your browser, or inspect it in WordPress on the backend.

The number or page name (usually the "slug") is the important part. If you want to exclude more than one, use a comma.

ex: wp_list_pages('title_li=&depth=1&exclude=6,8')

If you cannot find the page_id, here’s a tip:

To find the page id instead of the slug or page name on newer WordPress installs, go to the backend, click on the pages (or posts) edit menu, hover you mouse over the page name and look at your status bar in the bottom of your browser window, it will end in a number. That number is your page_id. This page_id is a way to load that page. You can substitute it for the slug to find any page on your blog.

ie: www.myblog.com/new-page will also load with www.myblog.com/?page_id=3

from: http://codex.wordpress.org/Template_Tags/wp_list_pages

Posted in Wordpress Tips. No Comments »

How to hide your text blog title that appears over the banner in WordPress

To hide the WordPress page title which lays over the top of your banner image:

In your /themes/style.css file:
#header h1 { display:none }

This will allow your blog title to show in the window title and as the  link in google and other seach engine results while not allowing it to overlay your new banner.

Posted in Wordpress Tips. 2 Comments »

Worpdress page title – how to reverse it

To reverse the WordPress page title, that is the blog title and the blog name:

In your Themes directory header.php

For WordPress 2.5 and up:
<title>
 <?php wp_title('--',true,'right'); ?>
 <?php bloginfo('name'); ?>
 </title>
Posted in Wordpress Tips. No Comments »

Making a custom print page layout for WordPress blogs

You can make a custom page layout that is called only when the person wants to print the page or print preview it.

Note: Some WordPress themes have a print.css stylesheet already created, so look for that in the theme directory first.

You must call the print stylesheet in the case of the browser being told to print the page. Do this by adding this to the <head> of your header.php:

<link rel="stylesheet" type="text/css" media="print"
href="<?php bloginfo('stylesheet_directory'); ?>/print.css" />

This is an example of a stylesheet for printing taken from the WordPress codex at:

http://codex.wordpress.org/Styling_for_Print

This example has been modified to hide Flash on the printout among other things:

--BEGINprint.css stylesheet--
/* t added created print stylesheet from scratch for this theme */
/* print style sheet is here */

@media print {
body {background:white;
     font-size:10pt;
     margin:0 }

/* t added to hide flash on printout      */
/* t added for custom flash style */
.flash{
    text-align: center;
    display: none;
}

#sidebar { display:none }
#header { height:75px }
#content{ margin-left:0;
     float:none;
     width:auto }
.demo .red { color:black;
     font-weight:bold }
#content a { font-weight:bold;
     color:#000066;
     text-decoration:underline }
#content{ margin-left:0;
     float:none;
     width:auto }
#footer, .ad { display:none }
h1, h2, h3, h4, h5, h6 { page-break-after:avoid;
     page-break-inside:avoid }
h3 { margin-left:10px;
     margin-bottom:0px;
     padding-bottom:0px }
blockquote, table, pre { page-break-inside:avoid }
ul, ol, dl  { page-break-before:avoid }
img.centered { display: block;
     margin-left: auto;
     margin-right: auto; }
img.right { padding: 4px;
     margin: 0 0 2px 7px;
     display: inline; }
img.left { padding: 4px;
     margin: 0 7px 2px 0;
     display: inline; }
.right { float: right; }
.left { float: left }
img { page-break-inside:avoid;
     page-break-after:avoid; }
}
--END print.css stylesheet--
Posted in Wordpress Tips. No Comments »

Removing a linked page title on a WordPress blog or changing the title

The page title on WordPress blogs is coded in the file is “page.php”. Search for the line with “<?php the_permalink() ?>” and then you can remove that link, or edit it and add some text.

To change the page title for Posts, edit the file “index.php” and search for the line with “<?php the_permalink() ?>”, then edit as desired.

Posted in Wordpress Tips. No Comments »

Moving a WordPress Blog from MU to the regular WordPress single blog install

To move the posts, pages, pictures, information, and settings of an existing, populated blog whether it’s on the single instance WordPress installation or WordPress MU with lots of blogs. This also applies to moving a wordpress blog from one server to another, or copying a wordpress blog:

You can use Admin->”Tools”->Export.

Then setup your new blog on your new server, Admin->”Tools”->”Import”->”Wordpress”.

This part on also applies to setting up a virgin wordpress install and converting it to a page based CMS instead of a post based website.

Then copy your theme over to the new location (server), this even copies a customized theme properly with images! (Copy the entire theme directory and subdirectories)
Now do your backend configuration by logging into blogURL/wp-admin.

Typical configuration Items I do:
1) Admin->Settings->Permalinks->/%postname%/ (this changes all page names to the slug instead of page?=)
2) Admin->Settings->Reading->Static Page->Home, Posts Page->Blog
3) Admin->Settings->Miscellaneous->Store uploads in this folder->wp-content/uploads (On the front end they will be in http://174.34.141.10/~blogname/wp-content/uploads/test.gif)

4) Admin->Settings->Miscellaneous->Full URL path to files->leave blank unless you don’t have a domain name in that case do this->http://174.34.141.10/~acctnam (you will have to temporarily link your images with /~acctname/wp-content/uploads/imagename.jpg. Remove the italicized /~acctname)/ part when changing to a blog with a Domain Name instead of IP/~acctname!
5) Admin->Settings->Miscellaneous->Uncheck “Organize my uploads…”
6) Copy all plugins to /public_html/wp-content/plugins and activate in Admin->Plugins
7) Configure each plugin as you active them Admin->Tools->pluginname (usually)
8) Check your images to make sure the path is the same, if not, make sure they are on the new server in the same location, check step 4 and 5 and check browser link to make sure URL base part is parsed correctly by step 4 and 5.
9) Admin->Settings->Writing->Default Post Category, set it to what got imported, should be set to the same Category  as your original blog.

This way you can migrate from a multi blog WordPress MU to a single blog, a WordPress single instance blog to another server, and possibly even from a single WordPress blog to add it to an MU installation with many blogs already.

Posted in Wordpress Tips. No Comments »

WordPress Submenus or subpages how to list child page links

From: http://codex.wordpress.org/Template_Tags/wp_list_pages
To list a child page menu while only on the parent page, in other words to display a submenu:

Put this inside the the_post() section of the page.php template of your WordPress theme after the_content(), or put it in a copy of the page.php template that you use for pages that have sub-pages (index.php is the template you want if you are using pages instead of posts):

<?php  $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');  if ($children) { ?>  <ul>  <?php echo $children; ?>  </ul>  <?php } ?>

A problem with WordPress 2.7 not showing submenus:
from: http://wordpress.org/support/topic/238967
There seems to be major issues with adding submenus in custom top-level menus with WPMU 2.7 I have a set of plugins that need to go into their own top-level menu, so one of the plugins does nothing but create the menu structure for the others. This used to work fine till 2.6.5 (the last stable version), but stopped working in the release 2.7

The problem is that the link that’s generated for the submenu is not of the form
admin.php?page=submenu.php,
but instead, it’s of the form
toplevelmenu.php?page=submenu.php

As a result, even though the menu items are added, clicking on them leads to a 404. This breaks several other plugins (one that I could immediately spot is Buddypress Friends plugin).

I searched in the forums, and found posts about similar behaviour for others as well, but it seemed unresolved (or had inexplicably resolved itself). After tracing through the code, it seems that there’s a little bug in the code in menu-header.php (fixing it worked for me – my plugins as well as the others started working).

on line 122:
$parent_exists = (!$admin_is_parent && file_exists(WP_PLUGIN_DIR . “/{$item[2]}”) && !is_dir(WP_PLUGIN_DIR . “/{$item[2]}”) ) || file_exists($item[2]) || ( file_exists( WPMU_PLUGIN_DIR . “/{$item[2]}” ) && ! is_dir( WPMU_PLUGIN_DIR . “/{$item[2]}” ) );

should be:

$parent_exists = !$admin_is_parent && ((file_exists(WP_PLUGIN_DIR . “/{$item[2]}”) && !is_dir(WP_PLUGIN_DIR . “/{$item[2]}”) ) || file_exists($item[2]) || ( file_exists( WPMU_PLUGIN_DIR . “/{$item[2]}” ) && ! is_dir( WPMU_PLUGIN_DIR . “/{$item[2]}” ) ));

(note the different grouping of conditions).
Like I said, this fixed the problem for me, and doesn’t seem to break anything (at least nothing that I’ve found yet). I’m posting this so that others can also take a look. Hopefully, it will help others with similar issues.


Listing Subpages of Subpages:
http://wordpress.org/support/topic/181936


Posted in Wordpress Tips. No Comments »

Worpress Sidebar Menus – Horizontal or Vertical?

Have been through lots of WordPress themes, and they almost always contain horizontal menus across the top as a top menu, or top navigation bar.

Instead, if you want to run your navbar down the left side as a vertical sidebar menu, you are very limited in theme choices.

I re-use a theme and re-theme it until I find a good solution, and a good and straightforward one.

Here’s what I’ve collected so far on the subject:


Try placeing this code in your header or where ever your menu is called from. You should have something like this right now?

<ul class="menu">
      <?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
</ul>

try making it this:

<div class="menu">
	<ul>
		<?php wp_list_pages('depth=1&sort_column=menu_order&title_li='); ?>
	</ul><br />
<?php
	if($post->post_parent)
		$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
		$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
	if ($children) { ?>

	<ul>
		<?php echo $children; ?>
		<?php } ?>
	</ul>
</div>

By replacing the code you mentioned it changes the horizontal menu into a vertical menu,see http://blog.narrowminds.nl/ to view what I mean.

I have already tried drop down menu plugins but I could not find a plugin that is really easy editable (css) to make the lay-out the way I want it.


Posted in Wordpress Tips. No Comments »

Moving WordPress MU to another server

WordPress MU is created to run in the root directory, not a subdirectory or folder!Three things to change when moving your WordPress MU install.
- Database
- wp-config (base setting, should be /)
- htaccess (rewrite base, should also be /)

WordPress API for Templates

WordPress API for functions

WordPress Template Tags

The API for WordPress functions is here.

Post, Page, Attachment and Bookmarks Functions
Category, Tag and Taxonomy Functions
User and Author Functions
Feed Functions
Comment, Ping, and Trackback Functions
Action, Filter, and Plugin Functions
Theme-Related Functions
Formatting Functions
Miscellaneous Functions
Classes
WordPress Variable Report
WordPress Hooks Table








Child Themes in WordPress

Child Themes in WordPress work like copies of an existing theme, which are editable, but don’t change the theme they are based on. It’s an instance of that theme, so the original theme that the child is based upon can be safely updated without worrying about breaking the original.

Here’s a great basic tutorial on Child Themes in WordPress

Another slightly more advanced tutorial on using a Child WordPress Theme

WordPress page title maximum length

My personal conclusion:
67 characters.

Page title maximum length for google

With WordPress you don’t get to use all of those characters by default and you must do some optimization to the engine to change this.

How to change WordPress page titles if you don’t have access to this article, you can request access from googlethem.

Blogging Tips for WordPress

These blog writing tips are for WordPress or any blog such as blogspot or blogger.

Write pertinent content regularly, if you want to ramble about different subjects, then tag them and/or categorize them differently so that people (or you) can view your entries chronologically and in a long page that are on a similar subject of interest.

To get listed in google and other search engines, you either need to be linked to from somewhere else on the internet, or you need to get proactive and submit your blog to google, submit your blog to yahoo.

If you have a page that you want removed, log in to WordPress, or your favorite blog engine, delete the post (blog entries are usually posts and not pages), then you still have to remove the post from google’s website cache.

Hyphens in URLs or URL Rewriting for WordPress SEO

Hyphens in URLs or “URL Rewriting” for WordPress SEO, Content Management Systems (CMS), Dynamically Generated Content and Shopping Cart Systems”:

If you have a dynamic website that creates pages from data then you are likely to have URLs that have stuff like http://www.mysite.com/product.php?product_id=8

This is not easy to remember, means nothing to a human or search engine, and does not help with google SEO or any SEO.

You should find out how to setup your backend, shopping cart engine, blog engine, or CMS to rewrite the URLs to search engine friendly versions like:
http://www.mysite.com/website-software/easy-website-maker

Howto URL rewrite in WordPress:Admin->Settings->Permalinks->Custom Settings->Enter text "/%postname%/"
Most WordPress installs I see do it this way instead:
Wordpress:Admin->Settings->Permalinks->Custom Settings->Check Radio button "Month and name"

Whalla! WordPress will now take care of the search engine friendly URL rewriting for you based upon your article’s title!

What really happens with URL rewriting on an Apache server (let’s hope this applies to you ;-), is that the .htaccess file gets rewritten by WordPress, but you can have direct control by looking and and if you’re brave, editing this file. You’ll need to know Regular Expressions (Regex) to even attempt this, a great tutorial on URL Rewriting is at addedbytes.com

Footnote: Are underscores in URLs ok to use? Well, they can only be in the path, which is after the domain name, not legal in a domain name, spaces are not either for that matter.

Matt Cutts from a speaking appearance at Word Camp 2007 said that underscores will be parsed like hyphens soon at google if not already (august 2007). He also dropped some info implying that google can parse dictionary words out of a domain name, but I wouldn’t count upon that, the engine has to work harder to pluck your keywords out of a oneworddomainname.com

Now for Matt’s quote from this website:
“Matt: Now the interesting thing is that we used to treat underscores as if they were like word A Underscore word B We would glom that together .And we would index that as A underscore B If you searched for the word A we wouldn’t have returned your post.
We are in the process of changing that. We might have already changed that.

So dashes and underscores are almost exactly the same. but in engine world dashes are nice because if there is no space at all the search engine has to segment it.”

WordPress Security Tips top ten

From: WordPress Security Tips and Hacks.

Ten security tips for WordPress.

WordPress Codex – Designing headers

Everything you wanted to know about designing Header Images in WordPress but were afraid to ask.

Even changing header images

Uploading or Posting Pictures in WordPress WPMU

To change the default image upload folder:
In the file: /wp-settings.php
define( "UPLOADS", "wp-content/blogs.dir/{$wpdb->blogid}/files/" );
When the problem remains that you have the uploaded files going into a /year/month subdirectory, there is a checkbox in the Admin->Settings  for not using the year date. However if you are using WordPress MU and you always want the uploads to not be deeply nested in a bewildering array of year/month folders, you can override this setting for all of your MU blogs by editing your /functions.php file to ignore the “uploads_use_yearmonth_folders” setting by modifying line 1855 (MU version 2.7)

from:  if ( get_option( 'uploads_use_yearmonth_folders' ) ) {
to: if ( get_option( '' ) ) {

How to tell which upload directory your individual blog in WordPress MU is in:The /wp-includes/blogs.dir/ directory contains lots of numbered folders like 11, to determine which blog this folder belongs to go to your database and find the table for wp_blogs and this one will cross reference the blog names with the respective numbers.

About file uploads From a WordPress forum comment by a user sacredpath on:

When creating and uploading an image to wordpress.com here are some basics worth remembering:

(1) Be sure your image is one of these file types – jpg, jpeg, png, gif (Note that bmp’s cannot be uploaded due to size).

(2) Do not use anything in the file name except letters and numbers. Use no spaces, no dashes, no underscores, or any type of special character or punctuation, except for the dot between the file name and the extension. Also make sure that the file name has an extension.

(3) If you are using iPhoto, then use the “export” function under the file menu to export the image to your desktop before trying to upload it to WordPress.

(4) If you are not using the image in thumbnail size, make sure that the image is not too wide for the post area in your particular theme. You can find maximum image widths for the most popular themes here: http://faq.wordpress.com/2006/09/25/how-big-can-my-images-be/

(5) Optimize your images so that your blog pages will load faster. See http://faq.wordpress.com/2006/05/08/optimise-your-images/

(6) How to upload pictures in posts: http://faq.wordpress.com/2006/07/16/how-do-i-upload-pictures/

(7) How do I get text to go around a picture? http://faq.wordpress.com/2006/05/29/how-do-i-get-text-to-go-around-a-picture/

(8) How do I upload larger pictures? How to increase the file size limit on uploads with WordPress.

What are Trackbacks, Pings, Pingbacks and Permalinks?

They are all eloquently explained on an official WordPress information page about “Introduction to Blogging”, halfway down the page it gets more interesting to those who already know what a blog is and are more interested in how to optimize or market their blog.

How to add an image to your WordPress feed

This is directly from the page David – Adding the image tag to WordPress’s rss headers

The RSS specification allows you to have an <image> element in the header of your RSS feed.  A long time ago, if you used WordPress, you’d have to edit the wp-rss.php file and be very careful when you upgraded to new releases, or your change could be lost.

But if you use a modern version of WordPress, you should take advantage of the do_action(‘commentsrss2_head’) hooks* in the feed-rss… .php files.

Here’s what you’d do: Add the following code to your theme’s functions.php file:

function add_my_rss_image()
{
    echo '<image><title>', bloginfo_rss('name'), '</title>';
    echo '<url>', bloginfo_rss('url'), '/images/button.gif</url>';
    echo '<link>', bloginfo_rss('url'), '</link>';
    echo '<width>88</width><height>31</height>';
    echo '<description>Description of your blog.</description></image>';
}

add_action('rss2_head','add_my_rss_image');
add_action('rss_head','add_my_rss_image');
add_action('commentsrss2_head','add_my_rss_image');

Take care to actually put an image file in the path specified, and adjust the width and height accordingly.

Et, voila! Now your feeds have images, and they’re forwards compatible with future versions of WordPress. Oh, did I say future versions of WordPress? Excuse me, I have to:

svn sw http://svn.automattic.com/wordpress/tags/2.6/

Blam! Upgraded. Sweet.

* Also rss2_head and rss_head, just so I cover the appropriate Google terms.

WordPress Codex

The definitive guide to doing anything with WordPress, from the horse’s mouth:

http://codex.wordpress.org/Advanced_Topics

They have the WordPress Codex function list among other valuable things.

Adding google analytics tracking code to your WordPress installation the easy way

Insert your tracking code generated from google analytics into your footer.php for your specific theme that your blog uses, WARNING! if you switch themes you will need to go back and add that tracking code to the new theme!

\wp-content\themes\yourthemenamehere\footer.php and do a search for the </body> tag.

Directly above the </body> tag paste in the code given to you by Google analytics. It should like something like this:

The new google tracking code:
<script type=”text/javascript”>
var gaJsHost = ((“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
document.write(unescape(“%3Cscript src=’” + gaJsHost + “google-analytics.com/ga.js’ type=’text/javascript’%3E%3C/script%3E”));
</script>
<script type=”text/javascript”>
var pageTracker = _gat._getTracker(“UA-1292736-8″);
pageTracker._initData();
pageTracker._trackPageview();
</script>

Or the old google (urchin) tracking code:
<script src=”http://www.google-analytics.com/urchin.js” type=”text/javascript”>
</script>
<script type=”text/javascript”>
_uacct = “UA-1234567-8″;
urchinTracker();
</script>

After adding the code for your specific website upload it to your correct theme folder using ftp.

How to increase the file size limit or upload limit with WordPress

This is a tutorial on how to upload large images and files on WordPress and WordPress MU – increase the upload limit.

There are several limits that you need to change before you can upload a large image file to WordPress for file uploads:

1) Php 3 Meg upload limit.

2) PHP interpreter code changes or modifications to get PHP to accept the large file size uploads.

3) Apache mime type not set right for file upload.

4) WordPress itself which has a default upload file size of 10Mb. This is for WordPress MU only.

Standard WordPress blogs at wordpress.com had 15MB and now 25MB limits (mid-2008), not including any images you use for your templates, those limits are just for you to store your images and files, 300KB for any individual file uploads (mid-2008).

The self hosted version of WordPress that you install is similar to WordPress MU, which is what I have experience with, if you have any doubts as to which of the 3 WordPresses I’m referring to, it’s self-hosted MU by default.

WordPress MU may look similar, but is a different animal altogether on the backend. You have much more control over every aspect of your wordpress blog with WordPress MU.

WordPress MU file size upload limit: from here on I am talking about WordPress MU, but the same applies to WordPress self-hosted.

If you are using MU, then you are storing your website on a host somewhere on the internet. This applies to your hosting account. If you don’t have direct control, it’s ok, just copy and paste these requests and email them to your webhost.

1) First limit is usually 3 Mb by default and is changed in the php.ini file at the host level.
Place this in your php.ini file in your root directory of your WordPress install (usually /public_html)
memory_limit = 32M
upload_max_filesize = 100M
upload_max_filesize = 100M
post_max_size = 100M

note: 100M is entirely too much for most use, this is to enable an upload of the largest file size possible through a web page!

Safer settings:

upload_max_filesize=5M and 20M
post_max_file_size=20M

2) I also had to do this to get the php interpretor to recognize the change and allow large files to be uploaded by adding this to the .htaccess file also in the root directory of my webserver for WordPress:
SetEnv PHPRC /home/yourusername/public_html

A temporary way to increase PHP’s memory is to add this to your PHP script, I prefer to set it above:
ini_set("memory_limit","12M");

3) Next limit was the fact that WordPress didn’t recognize the file type I wanted to upload, the upload was rejected with the message "file type does not meet security guidelines"

You need to add the file type association (windows terminology) as a “Mime Type” (linux server terminology) to the Apache server, or IIS if you’re doing windows hosting (let’s hope you’re not, linux beats windows hosting all day, every day, so far forever)

Find out what Mime Type you need to declare your new file as. ie. myfile.psd is a photoshop file, you probably know this, but your hosting server may not! Look up your file type here, w3schools is a great reference for all website code information, I use them all the time and consider them the authority on the subject of web code and standard ways of doing things.

To do this in WordPress MU use the Admin backend:
"Site Admin"->"Options"->"Upload File Types:" just type in the file extension of the type you want to add with a space separating each extension, no periods here!

I started doing this using pjw-mime-config WordPress Plugin, which will allow you to upload a file with tons of Mime Types already declared for you. WARNING! I found that it added as many listings for each Mime Type to a critical WordPress screen: Site Admin->Blogs->Edit->scroll down and you’ll see a setting for each mime type you’ve added, in my case I had more than 100! Do you want to crash your blog? After disabling PJW Mime types, I still have a super long Blog Edit Screen, it didn’t remove the data, each entry is non-editable for the respective extension (.tif, .psd, etc.) and says SERIALIZED DATA. I decided to use the standard WordPress way of doing it in the future, until I know how to undo this Plugin. Please post a comment if you know how. Update, you can remove mime types to the functions.php file in wp-includes directory at about line (1069).

4) This is for WordPress MU only. Next limit is not php, but WordPress itself which has a default upload file size of 10Mb, increase this in the Admin backend:
"Site Admin"->"Options"->Blog upload space" 1000MB is 1Gb
"Site Admin"->"Options"->Max upload file size:" 100000KB is 100Mb (this is the size of any individual file upload)

After doing this you should be able to upload anything up to 100 Mb for individual files and 1Gb for total storage for any user’s blog on the entire domain of your WordPress MU install.

After doing this you will likely run up against the limit of whatever hosting company you have your user account on, which is the account that WordPress is running on. Keep an eye out, it is either limited or you may get charged for extra storage space when your monthly hosting bill is due!

Update:
After making the changes above, I’ve been running some tests and running across a new limit. First my webhost says (and many do say this) there’s a 15Mb limit for PHP HTTP uploads. That’s 15 Megabyte limit for uploading files through a webpage to your server account not using FTP. Now I’ve got up to around 170 Mb through HTTP uploading and am hitting a different limit. First one is file types, large images are no problem, large audio files depend upon the format, even though the file types have been added to the server as Mime types. Same problem with alternate image types like .psd photoshop files, the error at the end of the WordPress upload right after “crunching”, is “File type does not meet security guidelines. Try another.” Renaming the same file to .jpg mitigates that problem, however I haven’t found an easy way to rename the file back to .psd using the HTTP upload interface (the upload webpage)

php ini files are simple and easy once you have your FTP connected. Have fun!

How to tell what version of WordPress you have running

View the source code of any page that WordPress created in a web browser.

This is autogenerated by a php code in your header.php
<# meta name="generator" content="WordPress <#?php bloginfo('version'); ?>
<#!-- leave this for stats -->

Check your Version. You can find the version of WPMU by looking at the page source of any page. If you are viewing the site you should see <meta name=”generator” content=”WordPress 2.5.1″ />, keep in mind the WPMU version is deprecated by 1, so 2.5.1 is really 1.5.1.

WordPress MU disable Make a New Blog

To disable “Make a New Blog” in wordpress MU:
You can modify wp-signup.php file:

Find string 14:

get_header();
and add after it this code:
if ( is_user_logged_in() ) {
$user = $current_user->user_login;
if ($user != 'admin') {
print "You can't create blogs.";
get_footer();
die();
}
} else {
print "You can't create blogs.";
get_footer();
die();
}

WordPress permissions for file uploading to a directory or folder

From: gfmorris.org

Dougal Campbell Says:
December 23rd, 2005 at 2:34 pm

Yeah, on all the servers *I* have dealt with, the web server runs as a different user. The exception would probably be web hosts who run PHP as a CGI process, which allows them to run it through suexec. But when PHP is installed as a module, it executes with the same permissions as the main apache instance, which is typically as the ‘nobody’ user (or a similarly unprivileged account).

You don’t *have* to make the wp-content directory writable for everything. Most parts of WP that need to write files under there are looking at particular subdirectory (cache, uploads, etc). Just make those writable, and there are fewer security concerns.

WordPress Include or Exclude Categories from showing up on the home page

Have you ever been working on a client WordPress project, or maybe your own blog and needed to exclude a Post category from the Front page? Or needed to exclude a Page from being included in a Search? CodeHooligans.com wrote a nice plugin to do this.

Worpress Tips and Tricks: Make your WordPress blog show up in google!

How to make your WordPress blog show up in google on the search results page when anyone searches for your blog or any text or tags contained in your blog. aka. Search engine Visibility 101.

First, make sure that your blog has the “Public” tag turned on, my WordPress MU installation in which you can post thousands of blogs had google visibility turned off by default!

The setting is in the Admin area of WordPress, you must be logged in as a blog administrator.

1) To log in to WordPress administration, do this by clicking “Admin” in the Meta Sidebar or the “Edit” link below a blog posting or by typing your blog location with /wp-admin at the end of the URL, like this http://wordpresstips.googlethem.com/wp-admin.

2) Click the navigation bar button “Site Admin” in WordPress.

3) Click the button below it “Blogs“.

4) Click the “Edit” link to the right of your blog that you want to show up in google.

5) Click the “Publish” radio button about 5 items down the edit page, it should be the first radio button.

6) Click the “Update Options” button to the right to save your choice.

7) Go to google.com and “add your url” by using this link

8) Wait a day or more and run some test searches for content that you know is in your blog.

WordPress tips and tricks: Changing the sidebar in WordPress

Changing the sidebar in WordPress:

1) You must be in the administration, do this by clicking “Admin” in the Meta Sidebar or the “Edit” link below a blog posting or by typing your blog location with /wp-admin at the end of the URL, like this http://wordpresstips.googlethem.com/wp-admin.
2) Click the “Presentation” button on the navbar across the top of the admin page.
3) Click the “Widgets” button below that.

4) Drag the any of the “Available Widgets” from the bottom up into the “Sidebar“, the first widget you drag will replace the default sidebar in WordPress.
5) Click the “Save Changes” button.

Remember, it may look like you have no sidebar specified, yet you have one, that is because you haven’t replace the default “fall  back”  widget working in the sidebar.

Here is the venerable WordPress Codex once again, this time on Widgets and Sidebars.

Stop SOPA