Archive for the 'wordpress' Category

Making Theme Widget Areas More Dynamic

Friday, October 21st, 2011

While designing a new theme for a client a problem came up that has come up before. Making a horizontal area a widgetized area, ie the header area next to a logo. This could also be in the footer of a theme. Instead of hardcoded the widths of each widget and making the layout static, I decided to make it have dynamic widths. By dynamic I’m not just talking about using percentage widths, but making the widths dependent on how many widgets are added to the area. Lucky WordPress has a handy function that will give counts of all the widgets currently active and in which area they are active. The documentation on the function is quite sparse wp_get_sidebars_widgets (more…)

Tags: , , ,

Google Maps API

Wednesday, February 2nd, 2011

In a recent project it was asked to provide a Google map on a number of pages. It would have been too time consuming to create a custom map and manually place the code on each page. Instead using the Google Maps API was a better choice because the address could be pulled from a custom field in the post and used to create the map. With the code below adding a Google Map is simple.

The first step is signing up for a API key, as with most Google products is free and only requires a Google account. After you’ve received your key, you can then edit the functions.php file of your current theme. The below code has some key spots to take note of and maybe change some values. I will highlight these after the full code.

(more…)

Tags: , , , , , ,

WordPress Self-Hosted Plugin Update API

Friday, December 17th, 2010

Have a plugin that can’t be submitted to the official repository?

Code is now on GitHub please see here for updated version.

Many reasons exist but the biggest is that the plugin/support is sold therefore can’t be downloaded for free. But why should the end user be punished after all they bought the plugin and updates should be just as seamless as from the official repo. With this script this can be accomplished. Examples and a package of sample code can be downloaded below.
(more…)

Tags: , , ,

WordPress Theme Developers Tip – Theme Update Noticifications

Friday, September 17th, 2010

While doing some work for a client, they were wanting to tie into the update notifications that a user gets when a theme has an updated version in the WordPress theme directory. The catch is this was a premium theme that was being sold so couldn’t be submitted to the directory. While not as robust as the WordPress update system it doesn’t need to be most premium themes require you to log in to download updates. So a simple notification was sufficient. Please read more to see code and explanations. (more…)

Tags: , , , , ,

WordPress Theme Developers Tip – Automatic Feed Links in 3.0

Thursday, May 20th, 2010

Version 3.0 of WordPress is due out soon, and theme developers are getting geared up to implement the new features. The new menu system has received much attention as it’s one of the biggest changes, besides the merge of the WPMU code, that most users will use.

One feature that I didn’t know exists until now is automatic feed links which will output all the different feed links to current page the users is on to the header. It was added in 2.8 but has been changed how it works for 3.0. For example on a single post page the main blog feed, and the single post comment feed links are added to the header allowing a user to easily subscribe to the either feed. Another is on a category archive page the feed for the main blog, as well as the feed for all posts in that category are added. So I’ve got this feature added to my Techozoic theme but to maintain backwards compatibility I though I would share the simple function I came up with.
(more…)

Tags: , ,