Archive for WordPress Tipswordpress-tips category image

wordpress-tips category image Individual Post Styling

Sometimes it is very handy if you can change the styling for a particular post, but not have to change it for all. I would imagine there may be a plugin available that does this, but to be honest, I haven’t actually looked.
Anyway, one easy way to do it is to take note of the ID for the post you want to style and then apply a bit of styling within the post itself.
To find the ID for the post is easy. You can see it when you are actually writing the post, so just look in your browser address bar and you will see something like the following:

http://jamesict.com/wp-admin/post.php?action=edit&post=96&message=7

The important bit we need is the post=96 [just take note of the number].

And all we have to do is then apply a bit of styling via some quick CSS.

To do this we apply some style tags and throw in whatever CSS changes we choose. I have made a simple background colour change to this post by applying:

#post-96 .entry {background:#BEC3B3;text-align:justify;}

In my CSS, the posts also fall under a class of .entry too, so I have included this in the CSS change.

wordpress-tips category image Permalinks are pretty

Permalinks often confuse people and this is probably because the term may sound a bit technical when first getting started with WordPress. However, when you think about it, the name does explain their purpose. It simply makes the ‘link’ in the url a pretty ‘permanent’ one. For example, without permalinks a default WordPress post would look like this: ‘http://jamesict.com/?p=2′. And as you can see, it is not exactly pretty is it? So, the alternative is to set the permalinks into action which will change the url completely.
Now the thing is, it can be set in many ways, with the most common one in use being to set the year/month and post name as the path in the url. This means that a post titled Permalinks are Pretty would become ‘http://jamesict.com/2008/11/permalinks-are-pretty’. The choice of inclusion in the permalink of the year and the month is so that if you have another post of the same name, say 2 years down the track when you have thousands of posts and cannot remember all the names, you will not produce a duplicate post with the same permalink. All makes perfect sense when you think about it.

So that explains what a permalink is and what it does. The next step is to work out how to actually set them in motion.

Unfortunately, this is where it takes a twist and turn and things get a little bit more tricky. Setting the permalinks structure via the admin panel – Settings – Permalinks, is easy enough, but when you first attempt to do this, it will not work. And yes, there is a perfectly good reason as to why not. You see, when you make this adjustment, the structure change tries to write some code to a particular file and the problem is [especially if you have a new WordPress default install], it is most likely you do not have this file at all. It is called .htaccess and is nothing more than a simple txt file with it’s only purpose being that it will include little bits of code that will be server specific and make such things as permalinks work. it’s to do with something called mod_rewrite, but I’ll let you read all about that in the Codex if it really interests you that much.

The point here is that it is very easy to make a .htaccess file. It can be done in virtually any text editor by opening a new file and then saving it as .htaccess. Notice there is nothing in front of ‘.’ and don’t worry, this is not a typo. and no, no need to write anything whatsoever in the file. Trust me – it’s not necessary.

So you make this file and the next step is to get it online. Again, tricky if you have never used something called FTP, but remarkably easy if you have. All you need to do is upload your .htaccess file to where your WordPress root files reside on your server. If you are not sure where this may be, just look for the location where there are lots of files all beginning with ‘wp-’ and drop in the same directory on your server. That’s that then? No, not quite, but almost.

This particular file needs to be written to when you make the changes via your admin panel, as mentioned above, and in order for this to happen, you need to give the file some special permissions. Again, this can be server specific, but more often than not, you can give it a permission of 777 [using your FTP program will accomplish this task] and then make the changes to your permalink structure in your admin panel. This is a security risk though, so as soon as you have made the changes, you should go back into your FTP and set the permissions back to something like 644. This will keep it safe enough from anyone doing any damage should they be of a ‘hacking’ character and inclined to be nasty to your and all your family.

In conclusion then, making the changes required to set your site to permalinks, is easy enough, but does require a few steps. The good news is that once it is done, you will probably not have to touch them again for as long as you wish to keep your site this way.

If you decide this is all too hard, just get in touch and I will give you a hand…

featured category image wordpress-tips category image FTP – it really helps

One of the more frequent issues that comes up when helping people get set up and started with WordPress, is that they often have no concept of what FTP [File Transfer Protocol] actually means. And as much as you don’t have to use an FTP program in order to run a WordPress site, there can be no argument that it is very beneficial if you do. Image upload functionality has greatly improved as each WordPress version has been released, but if you want to work on theme designs and make changes to graphics, headers and backgrounds using images, then FTP is a definite requirement.

FTP also provides much more flexibility in how you choose to keep your file structures on your site. By default, WordPress will upload files to a directory structure such as /wp-content/uploads/year/month/filename which is fine, but if you are like me, you may prefer to keep all of your audio files in one location and all of your images in another. FTP enables this choice – WordPresss does not.
So, if you would like to have more control of how you set up your themes, and upload your files and plugins, then FTP is an obvious need.

And luckily, there are many free FTP clients available for you to choose – even in the form of addons in browsers such as Firefox.

Three free FTP clients that I highly recommend:

FireFTP [a Firefox addon] ~ AL FTP ~ Filezilla