RSS
Currently Browsing: wordpress

Finding a Category Ancestor / Descendant for WP Templates

Recently I had a problem where I needed to find out if a specific category was a descendant of another category, or if one category was a ancestor of another. The latest website I am working on has a top level category called “Trips we do” and below that are many sub-categories and sub-sub categories etc. I wanted to use the same template on all of the categories that were descended from the “Trips we do”. Wordpress already has a function that returns the parent categories get_category_parents but this returns a string more suited for breadcrumbs. I needed a yes or no answer...
read more

Styling WordPress Dynamic Sidebar – dynamic_sidebar_params Filter

I have been working a lot lately on customizing my personal homepage theme. One thing I have not been happy about has been the right sidebar. The widget heading were just html text and didn’t have the rendered look that I wanted. I decided to reformat the sidebar and use images for the headings rather than just text. I had done some custom sidebars before but I wasn’t sure how to style each widget independently. The problem is that WP gives a generic class to each sidebar widget and you are only able to style all of them to look the same. The first place I looked for a function to do...
read more

WordPress – Use NextGen Gallery Code Inside an Excerpt

One problem with the ways that WordPress handles excerpt is that it always strips the HTML out. This is fine for most casual bloggers but when you are really trying to customize something for a client, it simply doesn’t cut it. What we wanted to do was use some of the NextGen Gallery markdown code in the “Excerpt” box of the post and have WordPress render this in the category archive. After some initial research I discovered that this markdown code is called “shortcode” in WP terminology. They have a whole Shortcode API. Now it was just a matter of finding the correct...
read more