Archive for September, 2009

Many people want WordPress to power their site’s root (e.g. http://example.com) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install the WordPress files to a subdirectory, but have your blog exist in the site root.

The process to move WordPress into its own directory is as follows:

1. Create the new location for the core WordPress files to be stored (we will use /wordpress in our examples). (On linux, use mkdir wordpress from your www directory. You’ll probably want to use “chown apache:apache” on the wordpress directory you created.)

2. Go to the General panel.

3. In the box for WordPress address (URL): change the address to the new location of your main WordPress core files. Example: http://example.com/wordpress

4. In the box for Blog address (URL): change the address to the root directory’s URL. Example: http://example.com

5. Click Update Options. (Do not worry about the error message and do not try to see your blog at this point! You will probably get a message about file not found.)

6. Move your WordPress core files to the new location (WordPress address).

7. Copy the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file.

8. Open your root directory’s index.php file in a text editor

9. Change the following and save the file. Change the line that says:

require(‘./wp-blog-header.php’);

to the following, using your directory name for the WordPress core files:

require(‘./wordpress/wp-blog-header.php’);

10. Login to the new location. It might now be http://example.com/wordpress/wp-admin/

11. If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can’t write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

from posting by Raphael Nikolai

The Problem:

Your post images does not align properly. May it be left, right or centered, it never aligns as it should be.

Cause:

This is an issue with your wordpress theme. The css styles that your current theme is using is incorrect or conflicting.

The Blog Fix:

The WordPress WYSIWYG editor automatically generates global/universal classes for each image alignment style that you desire. These CSS classes should be properly declared on your CSS stylesheet.

WordPress Global/Universal Image Classes:

/*global/universal image classes */
img.alignleft, img.left { float: left; }
img.alignright, img.right { float: right; }
img.aligncenter, img.center { display: block; margin-right: auto; margin-left: auto; float: none; clear: both; }
img.alignnone, img.block { display: block; clear: both; }
img.frame { background: #eee; border-style: solid; border-color: #ddd; }
img.stack { clear: none !important; }
img[align="left"] { float: left; clear: left; }
img[align="right"] { float: right; clear: right; }
img[align="middle"] { display: block; margin-right: auto; margin-left: auto; float: none; clear: both; }

/*—:[ image captioning ]:—*/
.wp-caption { border-style: solid; border-color: #ddd; background-color: #eee; text-align: center; font-style: italic; }
.wp-caption.alignleft { float: left; }
.wp-caption.alignright { float: right; }
.wp-caption.aligncenter { margin-right: auto; margin-left: auto; float: none; clear: both; }
.wp-caption.alignnone { clear: both; }

/*global/universal image classes */

I should work automatically after copying and pasting the CSS code above. You can edit the colors on each class if you want to customize how your images are displayed.

If still centering does not work, then look for conflicting img class in your css (hint: use CTRL F and look for for “ img { ” or “ img{ “).  If you find one then delete the margin set on that img class – centered images are displayed in blocks and margins should be set to automatic, that is why there should be no global margins set on your images. If it is possible, delete all other properties like padding, border, etc.