PHP posts

Introducing Laravel, part 2

In the first part of this introductory mini series we looked at simple routes and views and now we’ll look at how to work with controllers and models , how these two fit in the framework and how to use them. Controllers ... In the first part of this article I showed you how to link routes to views, but as you might have noticed we still haven't added any logic and that is where controllers come into play. Controllers contain public methods that are known as actions and a simple controller that calls a view looks...
read more

Introducing Laravel, part 1

Laravel is a PHP Web Application framework that works with the MVC pattern, as its website states: it’s the PHP framework for web artisans. Version 1.0 of Laravel was released just a couple of years ago and this PHP framework has definitely taken the community by storm with its simplicity and maintainability. Laravel makes creating web applications simple whilst also being easy to learn. Laravel works in a very focused way, allowing you to concentrate on what’s important for your application...
read more

A Customizable WordPress Weather Widget

In this weeks tutorial we'll be creating a WordPress widget to display the current weather for a specified location. To do this we'll be using the great Weather Underground API. You can sign up for a free developer account here, or sign up for a professional account to get increase request rates. Signing Up ... Once you've signed up and registered for your API key, you should see something like the following. To actually query the API we just need the API key. The Wunderground API does not use OAuth to authenticate...
read more

Customizing the WordPress footer by adding widgets

The footer is often overlooked when it comes to designing a site, but it's a great way to find contact details or other important pieces of information. People have been trained to look there since the days of letter writing. Even today if you look at any correspondence, utility bill or company letterhead you'll find important information. On websites it's an can be an important navigation tool, it can give you quick access to commonly needed pages that are not core to a site. In this quick tutorial we'll...
read more

5 Quick and Easy Tricks To Improve Your WordPress Theme

There are a few behaviors I normally change when I'm writing a WordPress theme. Some of them are pretty basic, but they can really enhance the theme my making it go that extra mile. Customize The Login Page ... Even though you can't include a custom login page in your theme, it's actually quiet easy to customize the existing one. If it's just changing the logo or giving it a completely different layout, the place to start is the login_enqueue_scripts action. Here you can decide to output a simple piece of...
read more

OAuth2 and the LinkedIn API – A WordPress CV/Résumé plugin

Continuing on from last weeks introduction to OAuth 2.0 using the Twitter API, this week we're going to focus on an alternate implementation of OAuth 2.0 used in the LinkedIn API. This implementation requires that you manually authorize the application before you can get a token. This implementation is a more complex as it requires you to be re-directed to the authentication server, which then re-directs you back to your own site with the approved token. This allows LinkedIn to add additional permissions...
read more

Turning a WordPress shortcode in to a Widget

In my last tutorial we created a shortcode for displaying recent Tweets using the Twitter API and OAuth2.0. Having thought about it a bit more, I think that it would be quite handy to have it as a widget as well. It's actually very easy to turn any shortcode in to a widget, and this logic could be used for lots of different shortcodes. Getting Started ... First up, we'll need to grab the source code from the previous tutorial. Underneath our previous class we're going to get the sample class from the WordPress...
read more

Using wp_cron to disable commenting on old posts

One of the little known, but incredibly useful functions of WordPress is wp_cron. It allows you to schedule tasks for execution at a later time, the tasks can also be repeatable. It's not perfect and does have one serious problem, in that it is only executed while users are actually navigating the site. But on a popular site this won't make a difference, but it's still worth noting. Something I see regularly been asked for is the ability to disable commenting on or delete/hide older posts, generally for...
read more
Load more