Category: Wordpress Snippets
-

Set Minimum Word Count to Publish Post
[ad_1] If you’re running a WordPress blog with multiple authors, then it’s important for you to maintain your blog’s content quality. With WordPress, you can restrict your authors to publish a post without having enough content. Here is a code snippet that lets you set a minimum word count for your WordPress posts. You can…
-

Disable WordPress Admin Bar for All Users Except Admins
[ad_1] By default, each registered user has the option of showing the Admin Bar on the frontend and/or back-end of the website. And user can change these preferences, just by visiting Users > Your Profile and choose to show/hide admin bar. Although it’s nice to have for some users but sometimes you don’t want to…
-

Display All WP Query Variables in WordPress
[ad_1] When developing a WordPress theme or plugin, it may be very useful to be able to output all WP Query variables. Here is a simple code snippet to do it easily. Paste the code below on any files, where you’d like to display the WP Query variables. <?php // display all wp query variables…
-

Add Custom Image Size to Post Thumbnails
[ad_1] Here we will see we can we add additional custom image size to post thumbnails in WordPress media uploader to use in our WordPress theme. WordPress has a built-in feature for Post Thumbnails. When you upload an image in any post or in media library, WordPress automatically resize and crop image to some predefined…
-

Enqueue Scripts and Stylesheets in WordPress
[ad_1] If you are a designer or a developer then knowing the proper way to enqueue scripts and stylesheets in your WordPress themes and plugins is very important. Because if you don’t do it proper way then you will probably run the risk of conflicting with other themes and plugins, and potentially creating problems that…
-

Add Custom Post Types to Your RSS Feed
[ad_1] WordPress has in-built RSS feed allowing visitors to subscribe. This RSS feed normally consist of just blog posts and it does not include custom post types in default RSS feed. Although WordPress does not offer any setting to include custom post types in RSS feed, but we can modify the WordPress query to keep…
-

Get Current Page ID Outside The Loop
[ad_1] With WordPress sometimes you’re not always working inside the WordPress loop. When you are working inside the loop, template tag the_ID can be used to easily get current page ID but if you are working outside the loop then getting current page ID is little tricky. Let’s look at how this is done. Inside…
-

Change Excerpt Length For Different Categories
[ad_1] Do you ever wonder how you could be able to change excerpt length based on category the post belongs to. In this article we will be discussing how to change excerpt length for different categories. Post excerpt has a default length of 55 words but sometimes you want to modify this limit for certain…
-

Remove WordPress Version From The Admin Footer
[ad_1] The WordPress admin footer bar shows the current WordPress version on the right side. But there are times when you want to remove WordPress version from the admin footer or perhaps you want to change it and provide additional link to your website for branding purposes. We are going to demonstrate both of these…
-

Remove Default WordPress Widgets From Dashboard
[ad_1] WordPress comes with a number of in-built widgets which allow you to easily add additional functionality to your WordPress theme. You can use WordPress Widgets to add content and features to your sidebars or to any other predefined widget locations. But nobody uses all the default widgets. In fact, there are probably a few…