Blog Archives
Create a Contact Page Part II
WordPress Coding & Design Last week I started a short series on creating a contact page for your site, and wrote about the form markup and CSS. This week I’m writing about validation. Contact forms are notorious for being insecure and left wide open for email header injections, allowing someone to hijack your form and spam anyone and everyone through it. However, there are steps you can take to ensure the email address supplied is valid, even the name given, is of ...
Continue readingCreate a Contact Page Part I
WordPress Coding & Design Once you’ve got an established blog you’ll most likely want a contact page with a contact form on it. Whilst there are a few plugins that do this for you, I tend to find that they either bloat your pages with additional CSS code in the header (CSS code should always be put in an external stylesheet whenever possible), badly written form markup, or probably the worst culprit, the PHP code doesn’t validate the information in the ...
Continue readingCreate Your Own Template II
WordPress Coding & Design Last week I explained how to set up your index.php file for your new template. This week I’ll cover the included files, ie. the header, footer and sidebar (if its needed as a separate file). The Header Your header needs to be in a file header.php. This is the file that the function get_header() will include, as explained last week. In the header file goes all the markup from the top of the design that needs to be on every page. First we ...
Continue readingCreate Your Own Template
WordPress Coding & Design Creating your own WordPress template is not as complicated as you may think. A lot of people suggest to use the default template and modify that. Personally I disagree. If you’re capable of writing your own HTML markup and CSS then all you need to know are the template tags and the wordpress loop. The only theme file I would recommend copying is the comments.php file, and I’d recommend using the Classic theme’s file, not the ...
Continue readingMixing Gallery and Blog Posts
WordPress Coding & Design This is part 3 on using the built in WordPress Gallery features. Part 1 and Part 2 are recommended reading also. So, you’ve created a few galleries, you’ve got your single image page looking spot on with all the details and EXIF data displaying. However when you create a new gallery what happens on the front page of your site? If you’re display the full post, the whole gallery will display. If you’re displaying an ...
Continue readingTheming Your WordPress Gallery
WordPress Coding & Design Last week I wrote about using the WordPress Gallery and EXIF features, introduced in WordPress 2.5. This week I want to explain how to create your large photo theme file. Last week (if you’ve not read last week’s post, I do recommend it before proceeding!) you may remember that I mentioned that when you click one of the thumbnails it will display the medium sized photo, and that you should be able to create a theme name image.php to ...
Continue readingWordPress Gallery and EXIF
WordPress Coding & Design The release of WordPress 2.5 included a built in gallery feature. Nothing major by any means, but it gave you the option of using a simple gallery to display your photos. It also included the ability to pull the EXIF data from your photos. However, whilst the features are there, there’s not much information or tutorials on using them. Hopefully this post will give you a bit more information on how to get the most from this new feature. ...
Continue readingControl Your Content Part 2
WordPress Coding & Design Last week I explained the 3 content tags, which you can use either in your WordPress template files or whilst writing your post. So how can you use these to create a different front page? Using a simple if statement you can determine which post you’re displaying and alter your settings to suit. For example, display your most recent post in full, then the rest of the posts in excerpt format. Using The Loop The WordPress Loop is used to ...
Continue readingControl Your Content Part 1
WordPress Coding & Design Controlling how your posts display throughout your site is easily done with a choice of 2 template tags and a bit of additional code. Full posts are displayed by using the_content() and excerpts are displayed by using the_excerpt(). the_content() and more This tag will display a full post unless you use the more tag. The more tag is set whilst writing the post. You can click a button on your post area’s toolbar or, if you’re not ...
Continue readingUsing Conditional Tags
WordPress Coding & Design Conditional tags allow you to control the information displayed on a page depending on whether a certain criteria is met. They’re always used in a standard PHP if statement and there are conditional tags for almost every check that you could think of. The PHP Code The PHP code used with conditionals is a standard PHP if statement. ie. if (condition) { statement here; } Using a Conditional Tag The most used conditional tag I use is the tag ...
Continue reading





