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: development, theme, tip, wordpress
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. 

