WordPress
WordPress is an amazing product, and Fantastico Deluxe helps with the install, but there are some issues and best practices.
When installing WP using Fantastico, make sure the permissions are secure after installation. Fantastico usually sets permissions on the public_html directory to an incorrect “755″. Make sure they are “750.”
Make sure the wp-config.php file permissions are set to “400.”
I’ve had two sites hacked into soon after installation so this is not just an academic exercise.
Settings
- Definitely change the permalinks. I don’t know why they default it with a URL (?p=123) format. You want smart names for your links. If you are going to add lots of posts, you may want to select the “Month and name” format. If not, go to custom Structure and put in /%postname%/
- Under media, you will likely want to uncheck the “Organize my uploads into month- and year-based folders”, unless you will have messloads of images you’ll be uploading. Definitely check the settings for sizes of images in medium and large. You will likely want to reduce the large to something like 800 px max.
- Reading — Unless this is a straight blog, you’ll probably want to create a page called “home” and one called “blog” and then go to the reading panel and set the front page display to static and set the home and blog pages.
Here are some must-have plugins:
- BackupBuddy — Premium (not free) plugin is the best in class to back up and migrate your site or just back up to the cloud or anywhere.
- Gravity Forms — Another best in class premium plugin for building forms.
- WP-Filebase — Great way to organize files and set up downloads.
- Facebook Page Publish — Will push posting to your FB page.
- WP to Twitter — Will push posting to your Twitter feed.
- Google XML Sitemaps — Will keep your sitemaps xml file up to date
- WP Better Emails — Changes the default “WordPress” email address and name to a nice HTML template with custom name and graphics
- WP Show IDs — This replaces “Reveal IDs for WP Admin” because it shows ids for custom post types also
- Theme My Login — Creates a nice login page based on the active theme.
- NextGen Gallery — The best in managing pic galleries
- Regenerate Thumbnails — In case you change the thumbnail sizes, this will recut them all.
- List category posts — Useful if post categories are used as a taxonomy, and you want to get a list of specific categories.
- Custom Post Type UI — This takes advantage of WP 2.9+ custom post types.
- Members — This plugin allow the admin to manage roles for different levels of users.
- White Label CMS –This customized the admin section. You can minimize to the items you want the user to see.
- CMS Tree Page View — This will insert a new menu item under page which gives a tree view of the pages. For sites with lots of pages and subpages, this is a better way to navigate pages in the admin section.
- Google Analyticator– There are several Google Analytics plugins, but this seems the best, which includes a nice dashboard widget/panel to view analytics from WordPress.
- Simple CMS — This is a basic plugin that simplifies the admin page for Editors and below. There is no way to change the settings, but it is a quick way to reduce the clutter for clients.
After my latest WordPress update (manually exporting mysql) I ended up with all my apostrophes appearing as “â€TM” –stupid junk characters. I finally figured out the solution, even though I don’t know exactly why it happened.
It was quite simple, jump in my wp-config, and comment out two lines.
# define(‘DB_CHARSET’, ‘utf8′);
# define(‘DB_COLLATE’, ”);
It worked like a charm.
Every system or framework has its idiosyncrasies. One for WordPress is embedding Flash files. It doesn’t happen easily.
Usually you could just embed an object right in the header.php or template file and it will work. But for some reason nothing happens when you try it in WP.
Apparently the swf file needs to be in the root directory, and even then the standard embed code won’t work. There is a plugin called Kimili Flash Embed that resolves this issue. Just install the plugin and put the following code in your php file:
[kml_flashembed movie="fileswf" height="380" width="730"/]
Here is an example embed code that WILL NOT work in WordPress
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" WIDTH="730" HEIGHT="380">
<PARAM NAME=movie VALUE="/home.swf">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED href="/home.swf" quality=high bgcolor=#FFFFFF WIDTH="730" HEIGHT="380" ALIGN="l" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">
</EMBED>
</OBJECT>
I’ve installed a lot of WordPress sites, and on some hosting sites there is a problem with file permissions, where WordPress doesn’t have the ability to use FTP, and prompts the user in the admin section to enter the FTP information. This is a pain, and sometimes it doesn’t work.
Basically, the best thing to do is try to avoid calling the hosting company because they will just direct you to WordPress. If you add the following lines in the wp-config.php in the root directory, it should resolve the problem. Remember, when you upgrade this fix will disappear so you’ll have to put the code in the new wp-config file.
define(‘FTP_HOST’, ‘localhost’);
define(‘FTP_USER’, ‘yourFTPuser’);
define(‘FTP_PASS’, ‘yourPassword’);
define(‘FS_TIMEOUT’, 900);
define(‘WP_MEMORY_LIMIT’, ’64M’);
I had a particular problem with Network Solutions during an install. They install a whole bunch of plugins and themes on the auto install, with a different FTP user, and so we don’t have permissions to delete the files, which means you can’t even upgrade a plugin. Nice.
Fortunately there is a good thread on the WordPress forum on how to resolve this. Basically you have to reset the FTP permissions from the NetworkSolutions control panel. I wish their tech support had a clue because they didn’t even find this issue in their system. I even escalated it to the supervisor and he didn’t seem to care this was their problem and it would happen with every install of WordPress. Whatever, they must field a lot of tech support calls and it costs them a lot of money…..
Starting in wp 2.6, css for image captions was added. Here is an example to be inserted in the style.css.
[code]
.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
padding-top: 4px;
margin: 10px;
/* optional rounded corners for browsers that support it */
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}
.wp-caption p.wp-caption-text {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
margin: 0;
}
[/code]
It is annoying that WordPress’ editor, after years, STILL does not allow you to put in line breaks. It removes them.
A way to trick it is to put in the following code:
<div style="height: 1.4em; visibility: hidden;">ANY_CHARACTER_HERE</div>
Here is the code to put into the sidebar that will list, if the page or its parent has children.
<?php
if($post->post_parent) {
// there is a parent, so
$sTitle = get_the_title($post->post_parent);
$theLink = get_permalink($post->post_parent);
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->post_parent.'&echo=0');
} else {
$sTitle = get_the_title($post->ID);
$theLink = get_permalink($post->ID);
$children = wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'&echo=0');
}
if ($children) {
?>
<div class="widget" id="subpages">
<h2></h2>
<div class="inside-widget">
<ul>
<?php echo $children; ?>
</ul>
</div>
</div>
<?php
} // End If children
?>
put this code in before the Loop (most likely this will be a page template). In the page, you need to add a custom field called “category_id” with the id of the category.
global $post; //wordpress post global object
$thecategory = “cat=”.get_post_meta($post->ID, ‘category_id’, true);
query_posts($thecategory);
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.



