Category Archives: Web Development

MySQL Header

Coding MySQL PHP calls the correct way

A vast majority of websites are coded using PHP. Chances are if you have a PHP website, it is being driven by a MySQL database back-end… and the chances are that the code you are using to get data to and from the PHP script to the MySQL includes the MySQL functions.

MySQL functions are quick and easy to implement; however they contain gaping security holes that easily allow SQL injections and cross site scripting attacks. For this reason, using the MySQL functions is being strongly advised against, by anyone in the know, including the PHP developers themselves. In short, it is essential that you remove these functions for the security of your website. At this point, a lot of developers may shy away from having to update what could be hundreds of scripts, however the changes required are actually not too much different than what you already have and in the end, is essential for the security of your website and services.

Continue reading

wordpress

Adding Ajax Pagination to Timeline in Wedding WP Theme

Wedding theme screenshot

Wedding theme screenshot

Wedding is a responsive WordPress theme that can be found here. I purchased the theme as I required a timeline feature on a site that I had been working on. The wedding theme happened to have a timeline that I liked. It had one small problem though… it had no pagination.

The site I needed the timeline for could potentially have a lot of timeline posts, so loading them all at once when the page loads was not ideal. So after reaching out to the author of the theme with no success, I modified the theme to enable a ajax load more pagination using the existing theme functions.

Continue reading

wordpress

Show Recent Blog Posts

When using WordPress as your CMS of choice, there often becomes a need to display a list of recent blog posts on a non-blog page (such as a static homepage).

For an example of this, just check out my home page here. The “from the blog” section is a custom bit of code that I wrote to display a list of recent blog posts.

The recent blog posts list is useful as it enable users to get a snapshot of what is going on in your blog, without actually having to visit the page.

There are two ways I explored to solve this particular problem:

  • Shortcode that can be placed anywhere
  • Snippet of code that sits directly in your template page file

This article will explore both ways.

Continue reading