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

Tag: Short Code Page 1 of 4

Ten ‘Must’ WordPress Snippets

Programming-4

Remove or Hide Admin Menu Links for Certain or Specific Users or Roles

The following snippet will let you remove as well as hide admin menu links for certain users or role.

Source: Snipplr

Get all media attached to a post

The following snippet will allow you to get all media attached to a post

Source: Pippinsplugins.com

Filter Category from Blog Page

The following snippet will filter category from the blog page

Source: brettwidmann.com

Custom Admin Login Logo & Alt Text

The snippet will allow you to have custom admin login logo and alt text

Source: Snipplr

Prev/Next wordpress loop links

Add the following snippet to previous/next loop links

Source: WordPress Codex

Admin Footer Modification

Source: Snipplr

Query a custom taxonomy

The following snippet will allow you to query a custom taxonomy, using the taxquery parameter

Source: Snipplr

Remove Personal Options from Profile Menu

The following snippet will allow you to remove personal options from personal menu

Source: Snipplr

Exclude Category from Feed

The following snippet will allow you to exclude category from feed

Load jQuery from CDN, fallback to local

Add the following snippet to your theme’s functions.php file

Source: Snipplr

Photo Credit: Flickr/hackNY.org

10 WordPress Snippets That You Don’t Want To Miss

Computer Programming

Update WordPress URL

Adding the following snippet to function.php file will let you update WordPress URL

Source: Snipplr

WordPress WP_ Settings

The snippet let you set some WordPress directories / paths directly to the server name.

Source: Snipplr

Access Request URI for template reuse

The following snippet will let you access request URI for template reuse

Source: Kovshenin

WordPress Widget Basic Stucture

Source: Snipplr

WordPress Child Theme

The following snippet will let you sort out the stylesheet

Source: doitwithwp.com

Custom Menus in WordPress

Source: Snipplr

SQL query to delete all media and attachments

The following snippet will delete all media in the library and remove all post attachments.

Source: WordPress.org

Simple iframe shortcode

Using the snippet will let you take iframe parameters and build an iframe through a shortcode

Source: Snipplr

Disable the WordPress file editor

The following snippet will disable the WordPress file editor

Automatically link Twitter usernames

Paste the snippet in the function.php file of your theme and it will let you automatically link Twitter usernames

Source: Snipplr

Search Posts by Custom Post Type

The snippet will let you search posts by custom post types

Source: WP-Snipp

Photo Credit: Flickr/Brad Montgomery

Ten ‘Must’ WordPress Snippets For Your Blog

Computer Program -3

Reduce spam by using .htaccess

Adding the following shortcode will let you reduce spam on your WordPress blog by using .htaccess. Simply paste the following lines into your .htaccess file but also make a note that you do make a backup of your .htaccess file before editing it.

Source: AllGuru.net

Display a thumbnail of any website

Simply paste the code below into your functions.php file.

Once done, you can use the snap shortcode:

Source: Geekeries.fr

Easily remove weird characters from your WordPress database

The shortcode will remove the weird characters from your WordPress database. All you have to do is simply run the following SQL query on your nWordPress database via the command line client or PhpMyAdmin.

Source: Jeff Starr

How to change WordPress editor font

Adding the following shortcode to your functions.php file will let you change the default WordPress editor font.

Source: DevPress

Removing the “read more” jump

Adding the shortcode into your functions.php file will remove the “read more” link from your blog which will automatically takes you to the article page.

Source: Alex Denning

Quick maintenance mode

Paste the following code into your functions.php file and you will be able to easily implement a maintenance mode on your WordPress blog.

Source: Skyje

Disable theme changing

Simply paste the code in your functions.php file to disable theme changing.

Source: Steve Taylor

Redirect feeds to a single format

Adding the following shortcode to your .htaccess file will let you direct all your feeds to a single format.

Source: Digging into WordPress

Simpler WordPress login url

Adding the following code to your .htaccess file will let you have the simpler WordPress login url.

Source: Kevin Chard

How to modify size of embedded videos

On adding the following shortcode to your theme’s functions.php file will let you modify the size of embedded videos.

Source: Shailan

Photo Credit: Flickr/hackNY.org

15 Most Useful And Required WordPress Snippets

Computer Program

Change footer-text in WP Admin

Using the code will change the text in the bottom of the WP admin pages.

Include Future Posts in RSS Feed

Adding the snippet to your theme’s functions.php file will let you appear your future posts in your RSS feed.

Remove meta-boxes

Using this snippet, you can remove the meta-boxes you don’t use.

Remove Gallery Settings

Gallery setting often make you irritated. The following snippet will simply remove all the gallery settings from the media upload section. All you have to do is simple add the code in your functions.php file.

Remove Login Shake

The following snippet has to be added to functions.php and it will remove the “wrong password” screen shake.

QR Code With Article Link

To have the QR-code rendered for every article, just insert the following snippet inside the WordPress loop.

Detect iPhone Users

The following snippet will helps you detect visitors which are using an iPhone, allowing you to create a better experience for them.

Remove Pages Columns

The code will allow you to remove a column from pages.

Enable debug mode

Add this to your wp-config.php and you will be able to debug your WordPress blog if something went wrong.

Check PHP Version

Since WordPress 3.2 version made its debut, PHP 5.2.4 is required for it to run. The time ever since development of plugins for this version come into existence you might require to check that whether the PHP version is up to date or not.

Hide admin ‘help’ tab

Seeing the ‘help’ tab all the time in the top right corner of the WordPress admin area will be a devastating experience for your clients. In order to let avoid such conditions on not to happen for them, simply add the following snippet in your functions.php template.

Hide ‘Screen Options’ Tab

If you hated the way the Screen Options tab appearing in front of you in your admin area, then adding this snippet to your functions.php template will do the trick for you. Simply add it.

Change Admin logo

Give your Admin panel a brand look just like whole of your blog; change the logo in the Admin panel with an image of your choice by using this snippet.

Get top level categories / taxonomy

The following code will allow you to get the top level categories and taxonomy.

Dynamic copyright text

The snippet below allows you to create an amazing copyright text for your footer by automatically updating the date using the the_date() function. Just add the code in to your footer.php file.

Photo Credit: Flickr/Helen Cook

WordPress Snippets – The ‘One’ You Don’t Want To Miss

Programming-4

Loading All Posts From The Current Week

The following snippet will allow you to load all the posts from the current week.

Source: MarketPress – Christian Brückner

Breadcrumb Without Plugin

While there are numbers of plugins available to breadcrumb your WordPress blog or website BUT what if you can do the same with simply adding the following snippet at your theme’s functions.php file.

Once done, open header.php and call the function:

Source: emoticode.net

Changing Dashboard Help Tab Contents

Using the following snippet, you will be able to change the contents of your dashboard help tab.

Source: WP Tuts

Automatically Adding Paragraph Tags

While using the wpautop(), WordPress itself add paragraph tags to the content and the excerpt BUT if in case you requires to add paragraph tags to any text automatically, then use the following snippet for the purpose.

Source: Daniel Pataki

How To Login In A WordPress User Programmatically

The following snippet will allow you to login in a WordPress user programmatically.

Followed by, to log in a user, do the following:

Source: evilsocket

Bringing Single-Column Dashboard Back To WordPress 3.8

With recently introduced WordPress 3.8, a whole new way to display the dashboard BUT if in case, you don’t like the way, then adding the following snippet to your theme’s functions.php will let you bring back single-column dashboard.

Source: Jeff Starr

Ordering Posts By Two Meta Values

By default, WordPress allows you to sort results of a query by one meta value, BUT if you want to order posts by two meta values, then adding the following snippet will help.

Source: WP Recipes

Displaying Recently Registered Users

The following snippet will display recently registered users.

Source: emoticode.net

The ‘Most Required’ WordPress Snippets Part 3

Programming-3

Easy WordPress Drop Downs using CSS

The following WordPress snippets will let you use easily WordPress drop downs using CSS.

Source: AmberWeinberg

Change footer-text in WP Admin

Using the WordPress Snippets will change the text in the bottom of the WP admin pages.

Reduce spam by using .htaccess

Adding the following shortcode will let you reduce spam on your WordPress blog by using .htaccess. Simply paste the following lines into your .htaccess file but also make a note that you do make a backup of your .htaccess file before editing it.

Source: AllGuru.net

Redirecting your homepage to the first post

Simply paste the code to your site’s homepage file (mainly it is index.php file) and you will be able to redirect your homepage to the first post.

Source: Ashton Sanders

Include Future Posts in RSS Feed

Adding the snippet to your theme’s functions.php file will let you appear your future posts in your RSS feed.

Display a thumbnail of any website

Simply paste the code below into your functions.php file.

Source: Geekeries.fr

How to automatically add a search field to your navigation menu

On copying the code to your theme’s functions.php file you will be able to add a search filed automatically to your navigation menu.

Source: Ronald

Remove meta-boxes

Using this snippet, you can remove the meta-boxes you don’t use.

Remove Gallery Settings

Gallery setting often make you irritated. The following snippet will simply remove all the gallery settings from the media upload section. All you have to do is simple add the code in your functions.php file.

How to change WordPress editor font

Adding the following shortcode to your functions.php file will let you change the default WordPress editor font.

Source: DevPress

The ‘Most Required’ WordPress Snippets Part 2

Programming-2

WordPress AJAX jQuery script

Source: Snipplr

WordPress Child Theme

The following snippet will let you sort out the stylesheet

Source: doitwithwp.com

Gravatar Image as Favicon

The following snippet will let you have your Gravatar image as WordPress Favicon

Source: Forrst

Check if current post type is a custom post type

The following snippet will let you check if current post type is a custom post type or not

Source: Snipplr

Move the posts count inside the link of the Archive and Category widgets

The following snippet will let you move the posts count inside the links of the archive and category widgets

Source: Github

Custom Menus in WordPress

Source: Snipplr

Alert Shortcodes

The following snippet will alert shortcodes

WordPress Snippets Source: Snipplr

The ‘Most Required’ WordPress Snippets Part 1

Programming-1

WordPress Widget Basic Structure

Source: Snipplr

Get all custom taxonomies that are attached to posts that have another custom taxonomy

The following WordPress snippets will let you get all custom taxonomies which are attached to posts which have another custom taxonomy

Source: Stackxchange

Anti-Word Alert

The following snippet will alert on anti-words

WordPress AJAX loop template

Source: Snipplr

Add Custom Menu Support

The following snippet will add custom menu support

Source: ThinkVitamin

Increase server memory limit in wp-config.php

The following snippet will increase server memory limit in wp-config.php file

Source: Snipplr

Get Image Path Relevant To Theme

The following snippet will get image path relevant to theme

Source: BrightCherry.co.uk

WordPress Snippets – Part 5 of 5

Programming-2

Custom excerpt length

The following WordPress snippets will allow you to set custom except length

Source: Snipplr

Update WordPress URL

Adding the following snippet to function.php file will let you update WordPress URL

Source: Snipplr

get Custom post page name

The following snippet will allow you to have custom post page name

Source: Snipplr

Change role access to Menus and Widgets

Adding the following snippet to functions.php will let you change role access to Menus and Widgets

Source: WP-Snippet

Automatically Notify Your Members on New Posts

The following snippet will send an email to all registered users whenever a post is published

WordPress, page hook

Using the following snippet will let you change the code on the page which you are on

Source: Novastream

Alert Shortcodes

The following snippet will alert shortcodes

Source: Snipplr

WordPress Snippets – Part 4 of 5

Programming-7

Cached Twitter Follower Count

The following WordPress snippets will cached Twitter follower count

Add the first section of code to the functions.php of your WordPress theme. This code will cache your Twitter follower number for 1 hour and display the count within your template.

Source: Snipplr

Share wp-articles on Twitter

The following snippet will share wp-articles on Twitter

Remove Personal Options from Profile Menu

The following snippet will allow you to remove personal options from personal menu

Source: Snipplr

Get Posts By Term and Sort Them

The following snippet will get posts by term and even sort them

Source: Snipplr

Remove or Hide Admin Menu Links for Certain or Specific Users or Roles

The following snippet will let you remove as well as hide admin menu links for certain users or role.

Source: Snipplr

Add featured image thumbnail to admin columns

The following snippet will add featured image thumbnail to admin columns

Source: TCBarrett.com

Page 1 of 4

Powered by WordPress & Theme by Anders Norén