|

Fix wp_nav_menu on Custom Type Archives in WordPress

Recently I was working with an issue in WordPress where the site’s menu was not showing up on an archive page for one of my custom post types. There were a few troubleshooting things I tried, including the most common recommendation, use theme_location instead of menu when referencing the menu in your theme (code after the jump):

Quick Tip: Check to See if a Slug Exists in WordPress

Recently I was doing some work where I was importing RSS entries into a Custom Post Type in WordPress. Since there were no common IDs between the feed and WordPress, to prevent duplicate entries I tried comparing titles. This also proved to be an issue as titles aren’t always unique, and they weren’t in this case. I settled on comparing…

|

Quick Tip: Use Post or Page Slug as CSS Class in WordPress

I don’t know why, but for some reason, I thought WordPress already included the slug of a post or page in either the function body_class() or post_class(). Doing some work over this weekend I realized that’s not the case, but luckily, it’s very easy to do. The functions body_class() and post_class() serve as a way for you to easily customize…