WPContent Hi! Welcome to WPContent.com! I'm Eric and I post short WordPress tutorials showing you how to set up your WordPress blog exactly how you want it.

How to add any content between the first and second post on your WordPress blog

03 April 2010 ~ 1 Comment

Here’s a quick and easy way to add content (ads, user messages, images, etc…) in between the first and second post on your blog’s homepage.  I cover The Loop and how to use PHP if statements to control where your content gets added and how to avoid it getting repeated.

I also explain how to show the full article on the first 2 posts and the excerpts on the remaining posts.

YouTube Preview Image
Category: General

Get a 24-hour Free Trial membership to lynda․com and master WordPress

24 March 2010 ~ 0 Comments

Lynda is a great way to learn WordPress (and other software). Now they are offering a free 24 hour trial period! It’s definitely worth taking a look at if you want to learn more about WordPress or PhotoShop or CSS or…

Check it out here: Free 24 Hour Lynda Trial

Category: General
Tags:

How can I change permissions on my WordPress blog so that I can upload images?

02 March 2010 ~ 5 Comments

If you get an error like “Unable to create directory /home/path/public_html/wp-content/uploads/2010/03. Is its parent directory writable by the server?” the first time you try to upload an image or video, it’s most likely a problem with your server’s permissions.  And while this sounds like a scary  thing to fix, it’s actually quite easy.  In the video below I will show you how to change the permissions on your server so that your folders will be safe and you will be able to upload media.  Be sure to read more about changing file permissions here.  I show you how to change permissions using cPanel’s File Manager and through the free FTP program FileZilla.

YouTube Preview Image
Category: General

The WordPress flash media uploader doesn’t work. How can I fix it?

27 February 2010 ~ 0 Comments

Depending on your webhost’s server settings, the flash uploader may not work, which can be a real bummer especially if you upload a lot of media.  For those who are unaware, the flash uploader allows you to upload more than 1 piece of media at a time.  This is especially useful if you add many photos to your posts.

In this video, I show you how to force the flash media uploader to work.  Thanks to KimWoodbridge.com for the useful .htaccess code. This code will remove the “HTTP Error” message that you might have already received.

#BEGIN Image Upload HTTP Error Fix
<IfModule mod_security.c>
<Files async-upload.php>
SecFilterEngine Off
SecFilterScanPOST Off
</Files>
</IfModule>
#END Image Upload HTTP Error Fix
YouTube Preview Image
Category: General

Preventing your Wordpress cron schedule from conflicting with other cron schedules

01 December 2008 ~ 0 Comments

Setting up your own cron jobs in Wordpress is quite simple using the Wordpress filter cron_schedules.  I’ve searched the web high and low for info related to adding your own cron job to Wordpress and this blog post has got to be by far the most informative.

There is one thing missing from the post and that’s making sure your cron is compatible with all other cron jobs that other plugins may add.

I have written a plugin that uses the cron_schedules filter to add a cron job.  I wrote it as was suggested in Slaven’s blog post.  Then a few months later, one of my plugin users reported that the cron job of my plugin was not running at all.  It took me quite a few hours of testing but I finally figured out that another plugin’s cron was overwriting my cron.

So, here’s how to ensure that your cron job plays nicely with other cron jobs. The code I use here is based on the tutorial by Slaven which you should definitely check out.

Here is the original function which adds the new cron to Wordpress’s cron_schedules:

function more_reccurences() {
	return array (
		'weekly' =&gt; array('interval' =&gt; 604800, 'display' =&gt; 'Once Weekly'),
		'fortnightly' =&gt; array('interval' =&gt; 1209600, 'display' =&gt; 'Once Fortnightly'),
	);
}

Now, to make sure that your schedules do not overwrite any other cron schedules:

function more_reccurences($schedules) {
	$schedules['weekly'] 		= array('interval' =&gt; 604800, 'display' =&gt; 'Once Weekly');
	$schedules['fortnightly'] 	= array('interval' =&gt; 1209600, 'display' =&gt; 'Once Fortnightly');
	return $schedules;
}

In this example, we pass the $schedules variable to the more_reccurences() function so we have access to it from within the function. Then, we add two new associative arrays to the $schedules variable. Finally, return the $schedules variable with your new values added but without overwriting any of the crons that might have been set by other plugins.

I’ve had many users test this method setting a cron job and I haven’t had any problems so far. Again, I would like to thank Slaven for his original tutorial!

Category: Plugins