The WPFolks app is out on iPhone and Android. Free, no ads. Download on the App Store Get it on Google Play
Skip to main content
Login Join

Functions

Add Estimated Reading Time to WordPress Posts

Show readers an automatic “5 min read” message based on the amount of text in a blog post. Steps Add the code below to your theme’s functions.php. Save the changes. Open a blog post. The estimated reading time will appear before the post content.


Automatically Add Featured Images to WordPress Posts

If you often forget to set a featured image, you can automatically use the first image inside the post content as the featured image. Steps Add the code below to your theme’s functions.php. Publish or update a post that contains an image. If the post does not already have a featured image, WordPress will use […]


Disable WordPress XML-RPC

XML-RPC is a WordPress feature that allows external applications to communicate with your website. When you do not use XML-RPC functionality, you can disable it with a simple filter. Steps Add the code below to your theme’s functions.php. Save the changes. WordPress will disable XML-RPC methods that depend on the xmlrpc_enabled setting.


Redirect Users After WordPress Login

You can automatically redirect users to a custom page after they successfully log in to your WordPress website. This is useful when you want users to land on a dashboard, account page, or another specific section instead of the default WordPress location. Steps Add the code below to your theme’s functions.php. Change the destination URL. […]


Change WordPress Admin Footer Text

Customize the default footer text shown at the bottom of the WordPress admin dashboard. This is useful for adding your company name, support information, or a custom message. Steps Add the code below to your theme’s functions.php. Replace the text with your own message. Save the file. Open any WordPress admin page and scroll to […]


Redirect 404 Pages to Homepage

For SEO, blindly redirecting every 404 to the homepage isn’t always recommended. A custom 404 page is often better.





Add Custom Post Type to Body Class

Automatically adds the current WordPress post type as a CSS class to the `<body>` element using the `body_class` filter. This is useful when working with custom post types and custom themes, allowing developers to target specific post types with CSS or JavaScript without adding classes manually to templates. For example, a custom post type named […]


Proudly supported by