Static Website Template Engine

I have made some static webpages recently and I have been meaning to make an extremely simple template engine that will drive these sites.  I always have a library of functions for getting html headers, footers and common functions, but I didn’t have the template portion.  Here is a very easy to implement system that allows you to make static websites that do not need databases that load very fast.  It basically lets you define a set of pages and then will automatically serve the correct page from a folder.  This is instead of having to make new folders and index files for each new page.

U Choose Slider Plugin

This is a WordPress plugin I wrote that stores information about slider images in the database.  It also gives you a template tag that you can use to loop over the images and implement your own JS Slider in your theme.  It has a management page in the wp-admin dashboard so that you can add a title, description, link to follow, image url, and the ability to make it active or inactive.

Stream Phish iPhone App to AppleTV

As far as I can tell, there is no setting in the app to send audio to an AppleTV.  However!

I was watching a couple of YouTube videos from my iPhone streamed to the AppleTV.  I then went to the Phish App to listen to last night’s MSG Show.  To my surprise it started playing through the AppleTV.  I tested this and realized that after choosing the output from the YouTube App to be the Apple TV, that it then became the default output for the Phish App and voilà!

I know this has nothing to do with web development, but this is a trick i deemed important to share. 

 

Enjoy!

Reduce the number of requests in your WordPress theme

This simple code will allow you to load all of your themes css files into one request without a plugin.  I have not yet found a plugin that works with other plugins nicely as not all plugin authors play by the rules when enqueueing scripts and styles.  So i figured that I would start with my theme.  I wrote my own theme for this site based on the Twitter Bootstrap.  On its own, there would be a request for the bootstrap css file and one custom one for my theme.  And the javascripts would be one for the bootstrap and one for my custom js.

Revised Most Commented Post Plugin

Awhile back, I created a plugin that would allow you to put a template tag on your site to display popular posts based on the number of comments on posts. It was quick, dirty and not the best code I have ever written.

I have completely rebuilt it using the WordPress Widget system so you can add it to your sidebar via the Widgets Administration panel.

This widget works based on the number of comments on your posts. It takes the most commented post and gives it a value of 1. You can then pick up to three levels to compare the other number of comments per post. You can also pick the number of posts to display in your sidebar.

Community Funded Update

I would like to take this opportunity to explain some of the cool features and projects that are on Community Funded.  For a little background, I have been working on this site since I was brought in as a consultant in August, and became the Director of Development in November.  The website is a crowd funding website that takes advantage of the power of Mega Community Collaboration (MC2).  Here is what this about: MC² happens when motivated groups of individuals and organizations focus on common goals to maximize their community’s resources. Modern technology allows for the connection of many diverse communities to form The Community – which possesses all the resources and funds needed to make incredible things happen. Community Funded will transform this potential into energy through the power of MC² .

Fun with WordPress Transients

It has been awhile since I have written, but I wanted to detail how and when to use WordPress transients. First off, what are transients? WordPress has a great API for storing data that might be either the results of an expensive/complex query, or data that does not change that often. The rationale behind these is to make the pages load faster without having to do the expensive queries for every user that visits your site. They offer us an expiration date so that the data can be regenerated on a schedule.

I have two examples in the full article for you to review. Hopefully they will help you make your site more efficient.

Community Funded

So I have been working on a project that has become my main focus. I am really proud to be the developer for www.communityfunded.com. We currently have a splash page up that allows the public to register as a user.

Here is a brief summary of the project:

Community Funded will connect people, ideas and resources in historic new ways, empowering our communities and promoting “grass-roots economic recovery.” Anything’s possible when it’s Community Funded.

Please sign up to be a part of something really special.

Here is a link to our Facebook page with some more info and response from the public: https://www.facebook.com/CommunityFunded

Keep Users Based On Role Out of WP-ADMIN

Here is a quick and dirty way to keep your users out of the WP-ADMIN area.  I have not found a good way to redirect a user from the wp-login.php page to a custom page and not profile.php. (anyone knows, please let me know : > ). I needed this as i had a front end system for users to manage their profiles.  That part needed to look like the regular theme and not like the admin area.