WordPress Themes, Plugins, Tutorials, Tips And More...

Tag: WordPress Snippet Page 2 of 12

Snippets Collection 4

WordPress Settings

How To Show Admin Bar Only For Admins

Using the following snippet in your theme’s functions.php file, you will be able to show admin only for admins. Just copy and paste it and you are done.

Snippet Source/Credit: Jeff Starr

How To Customize Comment Count Text In WordPress

Using the following snippet, you will be able to customize comment count text in WordPress.

Snippet Source/Credit: WPSnipp

How To Deregister All In One Event Calendar In WordPress

The following snippet will let you deregister all in one event calendar in WordPress.

Snippet Source/Credit: Ditscheri.com

How To Print Current WordPress Template Being Used

Adding the following snippet to your theme’s functions.php file will let you print current WordPress template being used.

How To Make A Subdirectory Accessible With WordPress In Root

Adding the following snippet will let you make a subdirectory accessible with WordPress in root.

Snippet Source/Credit: DreamHost Wiki

How To Disable Sidebars And Widgets On Page Template In WordPress

The following snippet will let you disable sidebars and widgets on page template in WordPress.

Snippets Collection 3

WordPress CMS

How To Disable WordPress Comments Completely

The following snippet will let you disable WordPress comments completely.

Snippet Source/Credit: aotearoawebdesign.co.nz

How To Automatically Delete Trash On Daily Basis

When you delete a post or a page or a comment, it goes in a Trash instead of being removed permanently. Using the following snippet will ease you job of deletion and will tell WordPress to automatically delete the trash itself. Simply copy and paste the following lines of code in your wp-config,php file and you are done.

Note: Make sure that you do replace 1 by X to empty spam comments automatically every X days.

How To Show Content For Logged In Users

Adding this snippet to your theme’s functions.php file will let you show content only for logged in users.

Snippet Source/Credit: Snipplr

How To Redirect Users To A Random Post

The following snippet will let you redirect users to a random post.

Snippet Source/Credit: Smashing Magazine

How To Have Custom Favicon For Your WP-Admin

Using the following snippet, you will be able to have custom favicon for your WP-admin.

Snippet Source/Credit: Snipplr

Snippets Collection 2

WordPress

How To Add A Logo To A Template

Using the following snippet, you will be able to add a logo to a template.

Snippet Source/Credit: WPSnipp

How to count retweets in full text

Adding the following snippet in your theme’s functions.php file, you will be able to count retweets in full text.

Once saved copy and paste the following lines of snippets in your theme’s single.php file:

Snippet Source/Credit: WPRecipes

How To Automatically Link Twitter Usernames In WordPress Posts

Using the following snippet, you will be able to automatically link Twitter usernames in WordPress posts.

Snippet Source/Credit: Paulund.co.uk

How To Block Admin For All Users In WordPress

Using the following snippet you will be able to block admin for all users in WordPress.

Snippet Source/Credit: WPSnipp

How To Rename WordPress Folder

Using the following snippet, you will be able to rename WordPress folder.

Snippet Source/Credit: Snipplr

Snippets Collection 1

WordPress-Media-Upload

How To Prevent WordPress To Compress Your JPG Files

The following snippet will let you prevent WordPress to compress your JPG files.

Snippet Source/Credit: WP Snippets

How To Have WordPress Pagination In Your Website Without The Use Of Any Plugins

The following snippet will let you have WordPress paginate in your website.

Snippet Source/Credit: Smashing Magazine

How To Get Rid Of HTML In Comments

The following snippet will let you get rid of HTML in comments.

Snippet Source/Credit: TheBlog.ca

How To Easily Enable/Disable Debug Mode In WordPress

The following snippet will let you easily enable or disable debug mode in WordPress.

Once done, simply add a GET parameter to the url of the page you’d like to debug:

Snippet Source/Credit: Joost de Valk

How to define a minimum word count per post

The following snippet will let you define a minimum word count per post.

Snippet Source/Credit: Pippin Williamson

The Snippets Collection – 5

wordpress-logo

How To Make Term Edition Easier

Using the following snippet, you will be able to make term edition easier.

Once saved, add the following line of snippet on any category, tag or taxonomy template:

Snippet Source/Credit: Joost de Valk

How To Set A Maximum Word Count On Post Titles

Adding the following snippet to your theme’s functions.php file, you will be able to set a maximum word count on post titles.

Snippet Source/Credit: Pippin

How To Rearrange WordPress Categories Order

Using the following snippet, you will be able to rearrange WordPress categories order.

Snippet Source/Credit: Sebastian

How To Remove WordPress Version Number

Using the following snippet, you will be able to remove WordPress version number.

Snippet Source/Credit: Jeff Starr

How To Easily Get Post Content By ID

Using the following snippet will let you easily get post content by ID. All you have to do is to simply use the get_post_field() function to get the post content and you are done.

How To Prevent WordPress To Compress Your JPG Files

The following snippet will let you prevent WordPress to compress your JPG files.

Snippet Source/Credit: WP Snippets

Snippets Collection – 5 Of 5

Switching Hover/Touch Events For Desktop/Mobile Devices

The following snippet will switch the classical desktop hover events to touch events.

Snippet Source/Credit: jbkflex.wordpress.com

How To Make Accessible Menu Editor

Adding the following snippet to your theme’s functions.php file, you will be able to make accessible menu editor.

Snippet Source/Credit: Webundso

How To Simulate A View Of A Page With JavaScript Onclick

Using the following snippet, you will be able to simulate a view of a page with JavaScript onclick.

Snippet Source/Credit: Reiffs.dk

How To Add Rel=”Lightbox” To All Images Embedded In A Post

The use of following snippet will let you add rel=”lightbox” to all images embedded in a post.

Snippet Source/Credit: Snipplr

How To Change The CSS In WordPress

Using the following snippet, you will be able to change the CSS in WordPress.

Snippet Source/Credit: WPEngineer

Snippets Collection – 4 Of 5

How To Disable WordPress RSS Feed

The following snippet will let you disable WordPress RSS feed.

Snippet Source/Credit: bueitge.de

How To Divide Posts From One Category Into Two Columns

Using the following snippet, you will be able to divide your posts from one category to two columns.

Snippet Source/Credit: Snipplr

How To Get All WordPress Post Meta

The following snippet will let you get all WordPress post meta.

Snippet Source/Credit: Snipplr

How To Include Page Within Another Page

Using the following snippet will let you include page within another page.

Snippet Source/Credit: Snipplr

How To List Current Post Taxonomies And Terms

Using the following snippet, you will be able to list all the current post taxonomies and terms.

Snippet Source/Credit: Snipplr

Snippets Collection – 3 Of 5

How To Break Names Into Two Lines

The snippet will let you break names into two lines.

Snippet Source/Credit: FlashAlexander

How To Form Standard WordPress Comment

The snippet will let you form standard WordPress comment.

Snippet Source/Credit: Snipplr

How To Change Role Access To Menu And Widgets

By default, for changing menu and widgets, one will be requiring admin user roles. But, with the snippet below, you will be able to change role access to menu and widgets.

Snippet Source/Credit: WP-Snippets.com

How To Create Database For WordPress

Using the following snippet, you will be able to create database for WordPress.

Snippet Source/Credit: Snipplr

How To Execute Shortcode From Custom Field

The following snippet will let you execute shortcode from custom field.

Snippet Source/Credit: Leeboyce

Snippets Collection – 2 Of 5

How To Display Twitter Feed In WordPress

The following snippet will let you display Twitter feed in WordPress.

Snippet Source/Credit: Smashing Magazine

How To Execute Shortcode From Custom Field

The snippet will let you add shortcode to a WordPress custom field while by default; the option is not available by WordPress.

Snippet Source/Credit: Leeboyce.co.uk

How To Get WordPress Page Slug

The following snippet will let you get WordPress page slug.

Snippet Source/Credit: Snipplr

How To Add Custom WordPress Settings

Using the following snippet, you will be able to add custom WordPress settings.

Snippet Source/Credit: Snipplr

How To Add Facebook Comments In Your Website

Using the following line of codes below, you will be able to add Facebook comments in your website.

Snippet Source/Credit: TutsPlus

Snippets Collection – 1 Of 5

How To Disable WordPress Comments Completely

The following snippet will let you disable WordPress comments completely.

Snippet Source/Credit: aotearoawebdesign.co.nz

How To Add PayPal Button To Your WordPress Website

Using the following snippet will let you add PayPal button to your WordPress website. Remember to add the snippet to your theme’s functions.php file and you are done.

Snippet Source/Credit: Snipplr

How To Deactivate All WordPress Plugins

Using the following line of snippets, you will be able to deactivate all WordPress plugins.

How To Delete WordPress Post Revision From Database

The following snippet will let you delete WordPress post revision from the database.

Snippet Source/Credit: lesterchan.net

How To Display Recent Posts From All Sites

The following snippet will display recent posts from all sites.

Snippet Source/Credit: Snipplr

Page 2 of 12

Powered by WordPress & Theme by Anders Norén