Posts in Category: snippets

Adding or Including custom post type to default WordPress loop

Adding or Including custom post type to default WordPress loop by altering the ‘pre_get_posts’ function. Here it use add_action() function. This will help to display those posts (custom posts) alongside the default posts in the regular post feed.

Add this in you functions.php file

 

Read More

Hide page visual editor if certain template is selected

 

Read More

has_post_thumbnail() not working

Assuming that you’re in The Loop, you can fix this problem, by replacing:

with

 

Read More

Disable update notification for individual plugins / All

code for the plugin file itself:-


I like to put this in the actual plugin. Since I’ve only ever disabled updates on a plugin because I’ve edited or forked the code and don’t want to lose my edits on an update, I’ve already edited the plugin and thus don’t

Read More

Limit character in content and title in wordpress

or with readmore

 

Read More

Remove Admin Menus

 

Read More

Display admin menu urls – debug

 

Read More