Facebook really loves to play Popularity Police. If you don’t like enough of a Page’s posts, they stop showing in [...]
April 21st, 2011
Or: How to Strip <A> Tags From get_the_term_list
Okay, this one is a bit obscure and not terribly complex, but it took me a minute to solve, so here it is for the rest of the world.
I was working on a WordPress custom taxonomy as a way to store and display useful information about a post. Specifically, I was creating a “Venue” type to store nightclub names which could then be displayed easily throughout the theme’s code, as well as inserted via shortcode.
Creating the Custom Taxonomy
Creating the taxonomy itself wasn’t really that hard, and isn’t the main subject of this post, but for the sake of completeness, I’ll cover that briefly first.
register_taxonomy('your-custom-taxonomy-name', 'page', array('hierarchical'=>true, 'label'=>'Taxo Name', 'query_var'=>true, 'rewrite'=>true) );
In the above code, I’m registering the taxonomy “your-custom-taxonomy-name” to attach to pages (as opposed to posts). I’m declaring it to be a hierarchical type, like WordPress’ native Categories, with the label “Taxo Name” showing up as the label above it in the admin. The “query_var” tells whether it should apply to custom post types, and “rewrite=>true” allows for pretty URLs such as “mysite.com/your-custom-taxonomy-name/item” instead of the default “mysite.com/?your-custom-taxonomy-name=item”.
This declaration in your functions.php file will register the taxonomy with the database and put a new meta box next to your pages.
For more info on custom taxonomies and how they work, check out custom taxonomies in the WordPress codex.
Outputting the Taxonomies Without Links
Now, I wanted to output the taxonomy info into the theme; i.e., I wanted the theme to display the name of the venue in various places. My only problem was that while the most obvious choice for this was WP function “get_the_term_list()“, it outputs the taxonomy terms as links, wrapped in <a> tags. After some mucking around, I discovered two possible solutions. Keep Reading
March 29th, 2011
I’ve been using WordPress for about two years now, and in that time I’ve collected a core of plugins that I instantly install on any new WordPress site I create. The list is constantly updating as old plugins die off and new ones are born, but as of right now, I have ten that I install on nearly every site, and five more that I just love when the need arises. So, here we go with my essential WordPress (free) plugin roundup: 2011. Keep Reading
October 2nd, 2010
Let me first say this article is written with a bit of “snarkiness” born of frustration at GoDaddy. I included it for the sake of humor, but I hope no one takes offense; I know there are reasons you may choose to use GoDaddy, which is why I wrote this tutorial in the first place.
The first and best advice I can give you is not to install WordPress on GoDaddy.com. Seriously, just turn and run. Flail your arms around a bit as you go just to be sure you’re making your point. There are a host of other hosts (har har) you can choose from which have better WP support, better customer support, better security, and a better back-end UI. Personally, I use BlueHost, which took me about 10 minutes to set up even when I didn’t know what I was doing. WordPress.org also has a nice list of recommended WP hosts to choose from.
However, if you have a client who insists on using GoDaddy hosting, or if for some reason you, yourself, need to jump through their hoops, navigate their myriad of labyrinthine user dashboards, and trust to their sometimes spotty security, you’ll be glad for a guide by the time you’re done. Keep Reading
There are a lot of useful plugins for WordPress out there. I’ve seen so many “best plugins for WordPress” lists that I would almost feel guilty adding another one (though I make no promises not to eventually do my own roundup of stuff I use, anyway). Instead, today I’m going to recommend a particular WordPress plugin developer, Joost de Valk of the website, Yoast. I’ve never met or talked to him and don’t have any particular stake in his work, but it’s so helpful to me I’d like to give a shout out to him and, I hope, introduce some more people to some very useful plugins. (Disclaimer: The caricature dude on his site creeps me out a bit. You’ve been warned!) I currently use two of his plugins across a couple different blogs, and plan to add three more soon. Here is a quick rundown of my six favorite of the many useful plugins he makes.
First, Meta Robots, a handy WordPress plugin that helps you manage the robots meta tags for pages across your WP installation. You can tell search engine robots to no-follow or no-index the categories, tags, archives, or individual pages through simple site-wide and page-specific settings. Search engines hate duplicate content and will usually choose to show only one version, so letting them index your tag pages, categories, archives, and search results spreads link juice around your site without any good purpose, weakening pages through link channels that do you no good at all. I use Meta Robots in conjunction with the All-in-One SEO Pack plugin for complete search engine optimization control across my sites.
Secondly, Enhanced WP Contact Form is one of a few WordPress contact form plugins that I’ve tried, and works the best with the least hassle. Styling and customization are easy on this useful plugin. Joost himself has stopped using this plugin in favor the paid Gravity Forms, but he appears to still maintain it.
Sociable adds social links to the end of each WordPress post, letting users choose from a myriad of popular sites (99, according to the WP page) like Twitter and Facebook. I’ve moved on to use Sexy Bookmarks instead since I like the style better, but Sociable remains a solid and more subtle social bookmarking plugin.
Yoast has a number of other plugins which I haven’t used, but three caught my eye. Tweetbacks finds and imports Twitter messages that mention a post, then append them like comments. Optimize DB runs the SQL command “optimize_table” to clean up your WordPress database. Finally, his Google Analytics plugin adds Google code to all your WordPress pages for easy tracking. You can do this yourself by editing the header.php or footer.php files, but this makes it simple, and it lets you track outbound links.
Joost, thanks for all the useful plugins you’ve made and for keeping them updated. I wish you all the best towards your continued success.
I hope this list was useful to you. What do you think? Have you had success with these plugins, or perhaps found others with similar functionality that you prefer instead? Leave a comment below and share your thoughts.