Category Archive: WordPress
Posts about WordPress
Set attachment as featured image
Here’s how to set the first attachment as the featured image for posts in WordPress. This is useful for User Submitted Posts, which attaches uploaded images to each submitted post.
Disable or customize WP read more link
Quick snippet for customizing or disabling the WordPress “read more” link for the_excerpt().
Replace content in WordPress header.php
Here’s how to filter content in WordPress’ header.php template file using PHP.
Require user login for any plugin
Here’s a quick trick to require user-login for any plugin. For example, if you want users to be able to use your chat plugin only if they are logged in. Here’s how..
Add titles to previous_post_link & next_post_link
Here’s a quick way to include a title in previous_post_link() and next_post_link().
Display category name in WordPress
Here are two snippets for displaying the category name and displaying the category link in WordPress.
Display performance stats in WordPress
Here is how to display the page-generation time based on PHP and MySQL.
Two interesting WordPress infographics
Here are a couple of interesting infographics for WordPress. Interesting to get a larger view of the WP universe :)
Content negotiation for WordPress
Quick PHP script for automatically selecting the best content type based on what the browser accepts. Works as-is for WordPress, or is easily modified to work with any PHP page.
Private notes and members-only content
Two cool tricks today, shortcodes to display private notes and members-only content.
Shortcode for encoded email address
One way to help reduce spam is to encode your email address whenever displaying publicly. Here is a function that will do just that: display an encoded version of whatever email address you specify.
Replace all instances of a string in WordPress
Here is how to replace all instances of a string in WordPress.