The 3.1 update to Yoast’s WordPress SEO plugin brought with it a new feature—the ability to set a “Primary” category for a post. You’ll now see a “Make Primary” link when selecting categories (or a bold “Primary” label if one has been set). It's possible to use this primary category in a custom theme...

Sometimes "experience" means all the little stuff that no one ever bothered to write down. Learning code through doing will lead you on a zig-zag path from one problem to the next, that is different per-project. In starting a big website made with Yii, having never touched the framework before, I took notes on some of the issues and questions that arose while developing...

As a followup to my post about SEO-Friendly URLs using Yii, I figured I would post this function I created for displaying SEO-related tags in the layout.Using the Gii generator with the Yii Framework, a custom base controller is created that is a parent for the others. It already contained a property called pageTitle that was used in some of the views. I decided to keep this location and expand upon it by adding in some more properties related to search engine optimization, and then create a function to display the HTML...

Using Yii's implementation of ActiveRecord makes querying a database much easier for simple queries. For more complex situations, you will still find yourself having to write some straight SQL on occasion. In this case, using a custom query was not necessary. I was trying to add another search parameter, using the AR compare() method, to search a relation with a HAS_MANY relationship, and it was displaying an "unknown column" error. Without a proper example, it wasn't clear at first how to get this work...

Creating SEO-friendly permalinks for an application built using the Yii Framework was a multi-step process. I figured I would outline each part. First, you can use slugs to access your view actions with the help of an extension and entries to your urlManager. Removing "index.php" is as simple as adding a few htaccess rules and changing two options. To Force trailing slashes, some code can be added to your base controller. And lastly, to give yourself cleaner "/site/page/" URLs, some more entries can be added to your urlManager...

I recently was tasked with converting a Tumblr blog into WordPress. On Tumblr, or at least on the theme I was dealing with, they have a pretty fancy archive section that lists all the posts as images underneath the months. If there aren't images, then it shows a little text. To do something similar...

In creating my first Yii application, there were a few hurdles and stumbling blocks along the way. One of the first guides/tutorials that a new user to the Yii PHP framework is directed to is the "Creating Your First Yii Application" in the "Definitive Guide to Yii" . This is kind of a companion piece that has extra explanation, plus the first steps I made to start turning the example app (generated skeleton) into my custom web application.

Adding a “Subscribe to Newsletter” checkbox or radio button to an existing contact form is incredibly painless using the MailChimp API. Include one library file, and you’ll have access to all functions the API has to offer. In this example, I added a Yes/No radio selection. You could easily change this to be a checkbox. When "Yes" is selected, and the form is submitted, the contact form does its thing, and then the user is added to a MailChimp List.

If you have some PHP numbers you need to work with, creating a percentage bar is incredibly simple. Calculate the percentage, and then set a width on a DIV that can then be styled. To set this up quickly, I set the percentage bar to 100 pixels wide. For posting this, I've added a scale factor in case you want to make the percent bar wider.

A common feature of most new user registration forms is a message telling you whether your chosen username or e-mail is already taken. The check is done through an AJAX request. Using the jQuery Validation plugin, the remote option can be used to request a URL that returns JSON data. Using CodeIgniter, this URL is a new function in the controller used for registration. In this example, the register_email_exists() function returns true or false, after checking the entered form value against the database. See the following example code for the basic PHP and JavaScript you'll need to make this work.

Post navigation

Get In Touch

I’m a freelance front-end web developer/programmer, with an eye for design.
I enjoy making clean, functional, and detail-oriented websites using the latest
HTML5, CSS, JavaScript and PHP. Lately I've been working a lot with WordPress.Status: Not Accepting Work at this Time

Scripts & Projects

An NPC creator for fantasy RPGs. Geared towards D&D, Pathfinder, and other table-top games. Creates a random character with various physical and personality traits, armor & weapons, inventory items, and more, to help with roleplaying and backstory.