WordPress Snippets – Part 2 of 5

Programming-5

Automatically Remove Short Words From The URL

Adding the following snippet to your theme’s functions.php file will automatically remove short words (less than three characters) from your post title url.

Source: Kevin Chard

Conditional Tag For Blog-Related Pages

Adding the following snippet to your functions.php file will let you add conditional tag for blog-related pages.

Once done, you can use the function to detect if you are currently on a blog related page:

Source: Nathan

Check Whether A Plugin Is Active

The following snippet will let you check whether a plugin is active or not.

Source: Jean Galea

Using WordPress Shortcodes In Theme Files

The following snippet will let you use WordPress shortcodes in theme files.

Checking If The Current Post Is A Custom Post Type

The following snippet will let you check if the current post is a custom post type.

Once done, you can use the function as below:

Source: Jonas Ethomsen

Force Specific Pages To Be SSL Secure

Adding the following snippet to your theme’s functions.php file, you will able to force specific pages to be SSL secure.

Source: Kevin Chard

Check If A Post Contains Gallery

Adding the following functions.php file will let you check if a post has a gallery.

Source: WordPress Stackexchange

The Editorial Team

The Editorial Team

The Editorial Team at JustWP is a team of WordPress experts led by Karan Chopra.

You may also like...