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

Tag: Code Page 2 of 3

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

Best Of WordPress Code Snippets Collection – 5

Programming-7

How To Show Top Level And Child Pages In WordPress

The following snippet will let you show top level and child pages in WordPress.

How To Have A/B Split Google Optimizer For WordPress

The following snippet will like you to have A/B split Google optimizer testing done for WordPress.

Snippet Source/Credit: Snipplr

How To Have Content From Separate Pages Without ID In WordPress

The following lines of codes will let you have content from separate pages without ID in WordPress.

How To Add Gravatars For Authors In WordPress

Simply paste the following snippet and you will be able to automatically add the author gravatar to each of their posts respectively.

Snippet Source/Credit: emoticode

How To Add PayPal Functionality In WordPress

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

Best Of WordPress Code Snippets Collection – 4

Programming-6

How To Set Simple Embedding PDF Shortcode In WordPress

The following snippet will let you set simple embedding PDF shortcode in WordPress.

Snippet Source/Credit: WPRecipes.com

Setting Up WordPress Post Expiration Code

The following snippet will let you set WordPress post expiration code.

Snippet Source/Credit: nrbet.com

How To Delete Post From Front End In WordPress

Adding the following snippet will let you delete post from front end in WordPress.

Snippet Source/Credit: WordPress.org

How To Show Repeatable Region In WordPress Simple Fields Plugin

The following snippet will let you see repeatable region in WordPress simple fields plugin.

How To Fix UTF-8 Issues In WordPress

Adding the following lines of code will let you fix UTF-8 issues in WordPress.

Follow these steps:

(see “Performing the actual conversion on your live database” section)

THEN install this plugin:

(fixes UTF8 encoding IN titles).

Snippet/Source Credit: Snipplr

Best Of WordPress Code Snippets Collection – 3

Programming-4

How To Fix Visual Formatting

The following snippet will let you fix visual formatting.

How To Make Accessible Menu Editor In WordPress

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 Make Your Search Results Unlimited

Start by finding the below code in your search.php file:

Once you found it, simply replace it with:

Snippet Source/Credit: WPHacks

How To Redirect Users To A Random Post In WordPress

Pasting the following snippet to your page-random.php file will let you redirect users to a random post.

Snippet Source/Credit: Smashing Magazine

Best Of WordPress Code Snippets Collection – 2

Programming-1

How To Embed A Page Into Another Page In WordPress

Using the following snippet, you will be able to embed a page into another page in your WordPress blog.

Snippet Source/Credit: CSS Tricks

How To Rearrange Categories Order In WordPress

Adding the following snippet to your theme’s functions.php file, you will be able to rearrange WordPress categories order, completely the way you want it.

Snippet Source/Credit: Sebastian

How To Make Your Search Results Unlimited In WordPress

Start by finding the below code in your search.php file:

Once you found it, simply replace it with:

Snippet Source/Credit: WPHacks

How To Prevent WordPress To Compress JPG Files

Copy and paste the following snippet in your theme’s functions.php file and it will let you prevent WordPress to compress your jpg files.

Snippet Source/Credit: WP Snippets

How To Display An Advert After The First Post In WordPress

The following snippet will let you display an advert after the first post in WordPress.

Snippet Source/Credit: WPLift

Best Of WordPress Code Snippets Collection – 1

Programming-2

How To Disable Comments Completely In WordPress

Adding the following snippet will let you disable Word Press comments completely.

Snippet Source/Credit: aotearoawebdesign.co.nz

How To Limit Posts Per Page On Search In WordPress

Using the following snippet will let you limit posts per page on search page in WordPress.

Snippet Source/Credit: WordPress.org

Fixing HTTP Error In WordPress

Using the following snippet in your theme’s .htaccess code will let you fix HTTP error in WordPress.

How To Know That Which Theme You Are Using

Adding the following lines of code will let you know that which theme you are using.

Snippet Source/Credit: Snipplr

How To Change Editor Font In WordPress

Using the snippet below and you will be able to change the font the way you want.

Snippet Source/Credit: DevPress

How To Disable Plugins Update In Your WordPress Blog

Using the following snippet, you will be able to disable all the plugins in your WordPress blog.

Snippet Source/Credit: WP Snippets

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

Best Of WordPress Code Snippet Part – 5

Programming-2

How To Load All Posts From The Current Week

Using the following snippet and you will be able to load posts from the current week.

Source Snippet/Code: Christian Brückner

How To Add A Custom Message To The Editor Pane

Simply by copying the following snippet in your theme’s functions.php file, you will be able to add a custom message to the editor pane.

Snippet Source/Credit: WP Tuts

How To Remove Widgets From WordPress Dashboard

Simply paste the following snippet in your theme’s functions.php file and you will be able to accomplish the task.

Snippet Source/Credit: WP Guru

How To Delete WordPress Post Revisions Using Your Functions.php File

Simply paste the following snippet in your functions.php file and you are done.

Snippet Source/Credit: Hardeep Asrani

How To Limit Posts Per Page On Search

Just paste the following snippet in your functions.php file and replace the number on line 3 by the desired number of posts you wish to display and you are done.

Snippet Source/Credit: WordPress.org

Best Of WordPress Code Snippet Part – 4

Programming-3

How To Load jQuery From Google CDN

WordPress by default load its own jQuery in your theme BUT using the following snippet in your theme’s functions.php file will load the library directly from Google CDN.

Snippet Source/Credit: WP Tips

How To Paginate Your WordPress Site Like Dribbble

Simply paste the following snippet to your theme’s single.php file at the place where you want to display the dribbble-like pagination.

Snippet Source/Credit: Elliott Richmond

Adding Gravatars For The Post Author

Simply paste the following snippet and you will be able to automatically add the author gravatar to each post.

Snippet Source/Credit: emoticode

How To Change Author URL Base

Pasting the following code in your theme’s functions.php file will change the same. Remember to replace profile on line 4 by any slug you like.

Snippet Source/Credit: Kevin Chard

How To Redirect To A Custom Page After Registration

The following snippet will let you redirect to a custom page once registration got completed. Simply copy the snippet and paste it to your theme’s functions.php file.

Snippet Source/Credit: TheDeadMedic

How To Change WordPress Login Logo Title Attribute

On simply pasting the following snippet into your theme’s functions.php file, you will be able to change WordPress login logo title attribute.

Snippet Source/Credit: Dave Clements

Best Of WordPress Code Snippet Part – 3

Programming-7

Adding Custom Text To Your Website’s Login Page

Simply paste the following snippet in your theme’s functions.php file while to customize the message, you can do on line 3.

Snippet Source/Credit: WP Snippy

How To Show A Short Intro Of The Author Bio

In order to achieve this, all you have to do is to simply copy and paste the following snippet into your theme’s functions.php file.

Remember a thing more, once added the above snippet, add the following line of code at the place where you want to display a short introduction of the author byline:

Snippet Source/Credit: Tim Marcher

Changing Contents Of A Dashboard Tab

Just, simply paste the snippet below into your functions.php file.

Snippet Source/Credit: WP Tuts

How To Add A Breadcrumb To Your Blog

Simply paste the following code to your functions.php file and you are done.

Once done, call the following function by opening header.php:

Snippet Source/Credit: emoticode

Setting The Default Image Size In WordPress Galleries

Simply using the following snippet which you have to paste in your theme’s functions.php file with which you can set the default image size in your built-in WordPress galleries.

Snippet Source/Credit: emoticode

Adding Paragraph Tags Automatically In Your WordPress Blog

Using the wpautop() function, WordPress itself add paragraph tag to the content as well as the excerpt BUT if you wish to make an addition to this by adding paragraph tags to any text, simply add the following snippet and you are done.

Snippet Source/Credit: Daniel Pataki

Best Of WordPress Code Snippet Part – 2

Programming-6

How To Protect Your Blog Against Image Hotlinking

Using the following snippet you will be able to protect your blog against image hotlinking.

Snippet Source/Credit: WPRecipies

How To Search Within Post Type Only

If you want to force the search engine to search only within a specific post type, then all you have to do is simply copy and paste the following code into your theme’s functions.php file. Remember to change the post type name on line 4 and you are done.

Snippet Source/Credit: Hongkiat

How To Automatically Add Twitter And Facebook Buttons To Your Posts

Adding the following snippet to your theme’s functions.php file, you will be able to add Twitter and Facebook buttons to your posts. It will display both Facebook and Twitter buttons at the bottom of this post.

Snippet Source/Credit: WPRecipes

How To Remove Login Shake Effect At The Time When Error Occurs

Using the following snippet will let you remove the login shake effect when error occurs. Simply paste the following code in your theme’s functions.php file and you are done.

Snippet Source/Credit: WordPress Support Forum

How To Add .pdf Support To Your WordPress Blog Media Manager

Copy and paste the following snippet into your theme’s functions.php file and you are done.

Snippet Source/Credit: WP Tuts

Making Translatable JavaScript Strings On Your WordPress Theme

With the help of snippet below, you will be able to make translatable JavaScript strings on your WordPress theme. Make sure you paste the following code into your function.php file.

Snippet Source/Credit: WPTheming.com

 

 

Page 2 of 3

Powered by WordPress & Theme by Anders Norén