Vanishing WordPress Posts!!!

I had a shock today. In fact, I was terrified, livid and exasperated by what happened to me today: I lost a very long Wordpress article that I have been working on for several months; or, at least, I thought I had lost it.

I made a few edits and added some new details to the 140 Mafia Guide, saved it and viewed it to see that the article displayed as I wanted. Only, it wasn’t there to be seen. The comments were still visible but the article was, well, gone! I felt sick. I’ve spent ages working on The Guide, adding internal links and changing the layout to make it more user friendly. I wanted to rip my computer from the socket, throw it at a wall, jump all over it, pour petrol on it and burn it. I knew it wasn’t my computer’s fault that the article had disappeared but I just wanted to vent some anger.

The Perfect WordPress Adserver

O.K, So I lied, this adserver will work stand-alone and as a plug-in for Wordpress, Drupal and Joomla! It’s called OpenX and is a complete adserver solution. In fact, this is a buddy with benefits.

See the bookcase ads at the side of this page? They’re managed and delivered via OpenX. They’re not ordinary ads. OpenX uses built-in geolocation to determine which ads to serve so if you are in Europe you will see ads for Amazon.co.uk, if you’re in Canada you will see ads for Amazon.ca and if you’re from the US or anywhere else then you will ads for Amazon.com. It’s a very impressive product and it’s free.

Stop < pre > Text Overruns

Here’s the problem: when you write your own HTML or you use a content management system like Wordpress (using the HTML editor) and you want to showcase HTML code or any other code within a post then you have to do two things:

use Character Entities to represent the less than (< ), greater than (>), forward-slash (/), back-slash (\) and ampisand (&) characters so that the represented characters are displayed rather than used to designate code tags; and

use the

 and  tags to instruct web browsers to display characters within their opening an closing tags in a monospace font i.e a font where each character has an equal width.

WordPress Tips, Tricks and Advice FAQ

This is an old (read very old) general FAQ of WordPress tips, tricks and advice found in JournalXtra. Each question is linked to the article where you can find more detailed information about its answer. This FAQ was intended to be regularly updated but I forgot to keep updating it. Maybe I’ll update it some time soon. While waiting for me to update it you can view the site index for more WordPress related stuff.

How do I automatically display article comments on every page?

Edit your WordPress template’s index.php file (also called the Main Index Template) by adding

<?php $withcomments = 1 ?>

just after

<?php get_header(); ?>

and by adding

<?php comments_template(); ?>

just before

<?php endwhile; else: ?>

The second addition might already be present. If it is, there’s no need to add it.

How do I automatically expand replies to articles so they display on every page?

See the answer to the question above this

How do I stop the WordPress TinyMCE editor’s background from using my template’s colour scheme?

Edit your theme’s style.css file (the main css file) and add

body.mceContentBody {
  background-color:#FFFFFF !important;
  background-image: none;
  text-align: left;
}

To its very bottom. Do not put it at the top or in the middle, put it at the bottom to prevent it from being overridden by other styling information.

How do I change the category listing order?

Use the My Category Order plugin.

How do I change the page listing order?

Use the My Page Order plugin.

How do I change the link listing order?

Use the My Link Order plugin.

How do I change the position of the admin login link?

1, use the BNS plugin to move the meta links (dashboard login links) to the footer of your pages,

2, use the Sidebar Login widget plug-in.

How do I add a sitemap to my blog?

Use the Google XML sitemap plugin which will create a sitemap at yourdomain.com/sitemap.xml after you’ve set it up and clicked Build Sitemap,

How do I optimize my blog for search engines?

Use the Greg’s High Performance SEO plugin, SEO Friendly Images plugin and TagPig.

How do I redirect URLs?

Use the Redirection plugin.

How do I automatically tweet my posts?

Use the shorten2ping plugin with either the Twitter setting or Ping.fm setting.

How do I automatically broadcast my posts to social networks?

Use the shorten2ping plugin with the Ping.fm setting.

How do I change the category listing order?

Use the My Category Order plugin

How do I add social networking buttons to my posts?

Use the Sociable plugin.

How do I display a message to visitors based on where they’ve come from?

1, use the WP Greet Box plugin,

2, use the Target Visitors plugin.

How can my users upload their own avatars to my server?

Use the the Avatars plugin.

How do I add a ratings button to my posts?

Some themes provide this as an inbuilt option so check your theme’s settings. Alternatively, use the GD Star Ratings plugin to add either/both ratings stars and/or ratings thumbs.

Can I add a forum to my blog?

Yes you can. Use the Simple:Press plugin to add a completely integrated forum to your blog that resides within your blog’s template. The alternative is to cross-link your blog with a non-integrated forum package such as SMF or phpBB. Simple:Press is the most integrated option in that it’s designed to function with-in WordPress and not as a standalone product.

Can I write my blog using RSS feeds?

Yes. Use any or all of these three plugins: Feed WordPress, WP-o-Matics and/or WP Autoblog. WP Autoblog has been discontinued but I do have a copy of it and will provide if you ask nicely.

Can I add more options to the TinyMCE editor?

Affirmative. Use the TinyMCE advanced plug-in to unhide the secret options hidden by the WordPress development team. This plug-in also enables you to re-arrange the editor’s buttons’ layout. There’s a button in the TinyMCE editor called the “Kitchen Sink” (it looks like a TV screen with multi-coloured dots scrolled across it): either click it or remove it to display extra buttons.

What’s the best way to add ads to my Wordprss theme?

Use the Ad Buttons plugin to create a sidebar widget into which you may display ads. It’s easier than editing your WordPress theme. Other options are: javascripts that display text-link ads; and the Linkerator plug-in which allows you to attach links to keywords without editing posts every time you want to change the keywords.

How do I put a copyright notice at the bottom of my blog?

Either edit your theme’s footer (has to be done to every theme you use) else use the Blog Copyright plugin.

Can I automatically translate my blog into different languages?

It can be done using the Global Translator plugin which creates multiple language versions of your website. When using a translator plugin, be careful to write you posts in complete sentences with few to no unambiguous words; keep your grammar and syntax as pure as possible – short sentences might work best for some people; try to not end sentences with a preposition.

How do I display random posts in my side bar?

Use the Random Posts plugin.

Can I add a link directory to my blog?

Yes, there are several link directory plugins available; I like to use the WordPress Link Directory plugin because the frontend can be customized to look as I want it to look and the backend is intuitive to use. In all honesty, if you want a serious link directory (and not much of a blog) then you can use Joomla! as a pure link directory via a plugin or you can make a few edits to your WordPress installation’s files to make it into a directory not a blog.

How do I redirect my default RSS feed to my Feedburner RSS feed?

Install the FD Feedburner plugin and add your Feedburner feed’s details to its configuration page.

Is it possible to have post tags automatically written?

Yes, use the TagPig plugin. It scans the text in your posts, compares the words and phrases within it against keyword lists held by tagthe.net, Yahoo and your site’s tag database.

Can I copy the plugins from one blog over to another blog?

In most cases, yes. Some plugins must be installed afresh but, generally, most plugins can be installed by copying yourdomain.com/wordpress/wp-content from your source blog over to yourdomain.com/wordpress/wp-content of your destination blog. Once the copying is complete, visit the destination blog’s Dashboard’s Plugins page and activate the new plugins.

What’s the easiest way to add videos to my blog?

This answer assumes you do not want to use third party hosting when embedding your own video content.

Use Viper’s Video Quicktags to embed content from Youtube, Flickr and Google etc.., and to embed your own videos as uploaded to your WordPress media gallery or directory to your server.

Is there a user friendly gallery plugin for WordPress?

Absolutely. The most versatile and user friendly WordPress gallery (to my thinking) is NextGEN Gallery. It allows you to post thumbnails, full images and slideshows in various layouts. This plugin isn’t limited to javascript, it has a php display option too (don’t worry if you don’t understand that: javascript requires a viewers browser to have javascript enabled where as php only requires the viewer to have a browser capable of displaying graphics).

How do I stop code examples from displaying outside of my template?

You need to edit your template’s style.css file by adding the following code at the top of it:

pre {
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -pre-wrap; /* Opera 4 - 6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
word-wrap: break-word; /* IE 5.5+ */
white-space: -khtml-pre-wrap; /* Safari, not working --  maybe on Konqueror khtml */
color : #000000;
width: 99%;
font-size: 14px;
}

And you need to convert all instances of < to &lt; and > to &gt; and & to &amp; within the example code.

WordPress: How to Auto Expand Comments by Default

Just a little gripe I have with some of the WordPress themes created by some of those amazing designers out there. Some theme designers forget to provide the option to have the comment dialogue box auto expand at the end of articles. Not a problem when there’s a button stating “add comment here” but it … Read more

Clashing TinyMCE Editor Background

Easy to fix so this will be a short post except for text added for search engines…

Sometimes your content management system’s (CMS) theme and your TinyMCE editor’s editor field’s theme will clash their styles. For example, when your theme has a dark background color your TinyMCE editor will show a dark background in its text editor area which, if you use a dark text color, will make it difficult for you to discern your text from the editor’s background color (i.e black on black is black just as white on white is white).

The reason for this clash is that TinyMCE derives its styling informtion (the style.css details) from your theme’s style details; namely, the theme’s body tag’s styling data. To fix this, whether your using Wordpress, Joomla!, Mambo or any other CMS, all you need to do is add a short line of code to your theme’s css file.

The code to add should be similar to