Latest Blog Posts
How to Get the Absolute Parent of Any Child Page In WordPress [PHP]
You can use this code to find the absolute parent for any page: // Get the current page object $page = get_queried_object(); // Check if the current page has a parent if ( $page->post_parent ) { // Set the parent ID to the current page's parent ID $parent_id =...
How to Automatically Add a Signature to Admin Comments In WordPress [PHP]
Do you want to automatically add a signature to all comments created by WordPress administrators? It's really easy. Place this code in your theme's functions.php file or create a custom plugin with this code: /** * Custom function to automatically add a signature to...
How To Add New Input Fields to The Comment Form In WordPress [PHP]
Do you want to add additional fields to the comment form on your WordPress website? This will allow you to store additional data about your commenters. Place this code in your theme's functions.php file or create a custom plugin with this code: /** * Custom function...
How to Add Shortcode Support to WordPress Comments
Do you want to allow your users to use shortcodes in their comments? There's an easy way to do this. Warning: Allowing shortcodes in your WordPress comments can be a security hazard. Don't use the below code unless you know what you're doing. Place this code in your...
How to Stop Storing IP Address in WordPress Comments
Do you want to stop storing the IP Addresses of your website users who leave comments? Here's the code you need. Place it in your WordPress theme's functions.php file: /** * Custom function to stop storing IP addresses in WordPress comments * * @param array...
How to Remove Classes From Post Thumbnails in WordPress [PHP]
Today, I'll show you how to remove CSS classes from Post Thumbnails in WordPress posts. It's really simple and only requires adding code to your WordPress website. Place this code in your theme's functions.php file or create a custom plugin with this code: /** *...