Latest Blog Posts
9 Tips To Secure Your WordPress Website Right Now
Thousands of websites get hacked every day. Yours might be next. Even if you are using WordPress, there is a chance that your website can get hacked. Most of the reasons why websites get hacked can be easily prevented. You can secure your WordPress website even if you...
How To Check If Post Has a Gallery In WordPress [Snippet]
WordPress allows you to create image galleries in your blog posts without any third-party plugins. Do you want to style a post differently if it has a gallery? There's an easy way to know if a post has a gallery inside it and yes, it works inside The Loop as well....
How To Only Show Admin Bar To Admins In WordPress [Snippet]
By default, WordPress displays the Admin Bar for any user who signs in. This includes Subscribers, Editors, Authors, and any other custom user role you might add. If you want to display the admin bar only to the administrator users of your site, then you only need a...
How to Disable the Emoji Scripts In WordPress [Snippet]
WordPress converts emoticons like ":)" into image-based emojis. The scripts required for this might slow down your website. Or maybe you just don't want emojis on your website at all. You can disable emojis completely in WordPress by disabling the Emoji scripts from...
How to Display Posts Published This Month in WordPress [Snippet]
WordPress offers easy ways to query posts. There are dozens of conditions you can apply to query posts. Today, I will show you an easy way to query and display posts published this month. Here's the code you can use: $posts = get_posts(array( 'numberposts' => 10, //...
How to Get Post Ancestors in WordPress [Snippet]
Posts in WordPress are hierarchical and can have ancestors (Parents). If you have posted on your blog with ancestors, you might want to display a list of ancestors of the posts. There's an easy way to do it. Use this code snippet inside your theme's single.php file:...
How to Use Shortcodes in Widget Title In WordPress [Snippet]
WordPress doesn't allow using Shortcodes in the titles of your widgets by default. But there's an easy way to enable the processing of shortcodes inside widget titles. Place this code snippet in your theme's functions.php file to enable shortcodes in Widget titles in...