We've found 40 snippets tagged Posts & pages
Display Related Posts Without Plugin

Display Related Posts Without Plugin

You can display related posts without any plugin by using this snippet. You c...
Disable Comments in Old Blog Posts via PHP

Disable Comments in Old Blog Posts via PHP

It's common for spammers to target old posts have established traffic and goo...
Get The First Image From Posts & Display

Get The First Image From Posts & Display

For posts does not have featured image, we will get the first image from post...
Automatically Empty Trash in WordPress

Automatically Empty Trash in WordPress

This snippet will let you automatically empty trash in WordPress daily, weekl...
Automatically Link Twitter Usernames in Posts And Comments

Automatically Link Twitter Usernames in Posts And Comments

This snippet will automatically link twitter usernames (eg @WPCodeSnippet) in...
Show The Latest Sticky Posts In WordPress

Show The Latest Sticky Posts In WordPress

This WordPress code snippet will show you how to display latest sticky posts ...
Delete Post Revisions Using Functions.php File

Delete Post Revisions Using Functions.php File

To unclutter your WordPress database and optimize it, you should delete post ...
Change Excerpt Length For Different Categories

Change Excerpt Length For Different Categories

Post excerpt has a default length of 55 words but sometimes you want to chang...
Get Current Page ID Outside The Loop

Get Current Page ID Outside The Loop

Outside the loop, WordPress does not know what context it is in. To get curre...
Add Custom Image Size to Post Thumbnails

Add Custom Image Size to Post Thumbnails

WordPress has built-in function add_image_size(). Using this core function in...
Display All WP Query Variables in WordPress

Display All WP Query Variables in WordPress

When developing a WordPress theme or plugin, it's very useful to be able to o...
Set Minimum Word Count to Publish Post

Set Minimum Word Count to Publish Post

This code snippet will let you set a minimum word count for WordPress posts. ...