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

Tag: Short Code Page 2 of 4

The ‘Most Required’ WordPress Snippets

Programming

WordPress WP_ Settings

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

Source: Snipplr

List current post taxonomies and terms

The following snippet will let you list current post taxonomies and terms

Source: Snipplr

Stop directory index browsing

The following snippet will stop directory index browsing

Source: Ubuntuguide

Access Request URI for template reuse

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

Source: Kovshenin

Change user password in mySQL

The following snippet will let you change user password in mySQL

Source: Snipplr

WordPress default CSS

Source: WordPressAPI

Form standard WordPress comment

Source: Snipplr

WordPress Snippets – Part 3 of 5

Programming-6

View wp-posts in dropdown

The following snippet will allow you to view WP-Posts in dropdown

Source: Snipplr

Prev/Next wordpress loop links

Add the following snippet to previous/next loop links

Source: WordPress Codex

Query a custom taxonomy

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

Source: Snipplr

Customize Default Avatar

The following snippet will allow you to customize default avatar

Current theme link for WordPress theme

The following snippet will link to the current theme/template url for use in WordPress template

WordPress Theme Options Page

Using the snippet will creates a theme options page for your WordPress theme

Source: Themeshaper

Display your latest Google+ WordPress blog

The following snippet will display your latest Google+ WordPress blog

WordPress Snippets – Part 2 of 5

Programming-5

Automatically Remove Short Words From The URL

Adding the following snippet to your theme’s functions.php file will automatically remove short words (less than three characters) from your post title url.

Source: Kevin Chard

Conditional Tag For Blog-Related Pages

Adding the following snippet to your functions.php file will let you add conditional tag for blog-related pages.

Once done, you can use the function to detect if you are currently on a blog related page:

Source: Nathan

Check Whether A Plugin Is Active

The following snippet will let you check whether a plugin is active or not.

Source: Jean Galea

Using WordPress Shortcodes In Theme Files

The following snippet will let you use WordPress shortcodes in theme files.

Checking If The Current Post Is A Custom Post Type

The following snippet will let you check if the current post is a custom post type.

Once done, you can use the function as below:

Source: Jonas Ethomsen

Force Specific Pages To Be SSL Secure

Adding the following snippet to your theme’s functions.php file, you will able to force specific pages to be SSL secure.

Source: Kevin Chard

Check If A Post Contains Gallery

Adding the following functions.php file will let you check if a post has a gallery.

Source: WordPress Stackexchange

WordPress Snippets – Part 1 of 5

Programming-4

Redirecting To A Custom Page After Registration

The addition of the following snippet in your theme’s functions.php will let you redirect to a custom page after registration.

Source: TheDeadMedic

Adding Custom Text To WordPress Loging Page

The following snippet will allow you to add custom text to WordPress login page.

Source: WP Snippy

Author Bio Excerpt

Addition of the following snippet to your theme’s functions.php file will let you show an author bio excerpt.

Once done, using the following snippet will like to display an author bio excerpt.

Source: Tim Marcher

Automatically Adding Gravatars For The Post Authors

The following snippet will automatically add gravatars for the post authors.

Source: Emoticode

Changing Author URL Base

Using the following snippet will change author url base on your WordPress website.

Source: Kevin Chard

Removing Widgets From WordPress Dashboard

Addition of the following snippet in your theme’s functions.php file will let you remove widgets from your WordPress dashboard.

Source: WP Guru

Paginating WordPress Just Like Dribbble

The following snippet will paginate your WordPress website just like dribbble.

Source: Elliott Richmond

Email Alert For 404s

Quite possible the time when you want to keep track of 404 page on your website. Instead of doing this manually by keeping a track via log files, the addition of following snippet will ease your job.

Source: WP Mix

Must And Most Required WordPress Snippets (Part 3 Of 3)

Programming-3

Customize Default Avatar

Display Most Popular Posts from a Specific Category

The following snippet will display most popular posts from a specific category

Source: Snipplr

WordPress Theme Options Page

Using the snippet will creates a theme options page for your WordPress theme

Source: Themeshaper

Display the number of comments by author

The following snippet will display the number of comments by author

Source: Snipplr

Display your latest Google+ WordPress blog

The following snippet will display your latest Google+ WordPress blog

Get Posts By Term and Sort Them

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

Source: Snipplr

Add your own Logo to WordPress Dashboard

Adding the following snippet to your theme’s function.php file will let you add your own logo to WordPress dashboard

Cached Twitter Follower Count

The following snippet 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

Photo Credit: Flickr/Travis Swicegood

Must And Most Required WordPress Snippets (Part 2 Of 3)

Programming-2

Custom login

Source: Snipplr

Add featured image thumbnail to admin columns

The following snippet will add featured image thumbnail to admin columns

Source: TCBarrett.com

View wp-posts in dropdown

The following snippet will allow you to view WP-Posts in dropdown

Source: Snipplr

Move and rename “Featured Image” box

The following code will move and rename “Featured Image” box

Source: WordPress.org

Limit Search Results to Specific Post Types

The following snippet will limit search results to specific post types

Source: Snipplr

Current theme link for WordPress theme

The following snippet will link to the current theme/template url for use in WordPress template

How to Easily Disable Theme Changing

The following snippet will easily disable theme changing

 Share wp-articles on Twitter

The following snippet will share wp-articles on Twitter

Photo Credit: Flickr/hackNY.org

 

15 Amazingly Awesome And Most Required WordPress Snippets

Programming

Get all WordPress post meta

The following snippet will let all of a WordPress post meta data in an array without specifying a key.

Source: Snipplr

Custom excerpt length

The following snippet will allow you to set custom except length

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

WordPress, page hook

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

Source: Novastream

List current post taxonomies and terms

The following snippet will let you list current post taxonomies and terms

Source: Snipplr

Change user password in mySQL

The following snippet will let you change user password in mySQL

Source: Snipplr

WordPress breadcrumbs based on wp_nav_menu

Source: Stackxchange

Form standard WordPress comment

Source: Snipplr

get page or parent page id

The following snippet will let you get page or parent page id

Source: Snipplr

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

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

Source: Stackxchange

WordPress AJAX loop template

Source: Snipplr

Increase server memory limit in wp-config php file

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

Source: Snipplr

WordPress AJAX jQuery script

Source: Snipplr

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

Photo Credit: Flickr/hackNY.org

Must And Most Required WordPress Snippets (Part 1 Of 3)

Programming-1

get Custom post page name

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

Source: Snipplr

Automatically Notify Your Members on New Posts

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

Alert Shortcodes

The following snippet will alert shortcodes

Source: Snipplr

Stop directory index browsing

The following snippet will stop directory index browsing

Source: Ubuntuguide

WordPress default CSS

Source: WordPressAPI

Anti-Word Alert

The following snippet will alert on anti-words

Add Custom Menu Support

The following snippet will add custom menu support

Source: ThinkVitamin

Get Image Path Relevant To Theme

The following snippet will get image path relevant to theme

Source: BrightCherry.co.uk

Gravatar Image as Favicon

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

Source: Forrst

Photo Credit: Flickr/hackNY.org

Great WordPress Snippets Collection

Computer Program -2

Change WordPress “from” email header

Adding the following shortcode will let you use your real name or username instead of by default set WordPress email address which looks like as WordPress@yoursitename.com.

Source: KeenTricks

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

Automatically add Twitter and Facebook buttons to your posts

Adding the following shortcode to your functions.php file will let you automatically add Twitter and Facebook buttons to your posts.

Source: Dev7Studios

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

How to get category slug using category ID

Adding the following code to your theme’s functions.php file will let you get category slug using category ID.

Once done, you can call the function as shown below:

This will display the slug for the category with the ID 5.

Source: Ken Rosaka

How to count your blogroll links

Simply paste the following code where you want the count to be displayed and you will be able to count your blogroll links.

Source: Jeff Starr

Photo Credit: Flickr/hackNY.org

Essential Snippets For Your WordPress Blog

Computer Program -1

Easy WordPress Drop Downs using CSS

The snippet will help you creating an easy WordPress drop downs using CSS.

Source: AmberWeinberg

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

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

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

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

How to have a simpler WordPress login url

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

Source: Kevin Chard

WordPress is_child() and is_ancestor()

To use the following snippet, simply add it in your theme’s functions.php template.

Source: CodeByte

WP – Roles and Capabilities

The snippet will let you define different roles and capabilities.

Source: Snipplr

Clear out jquery to prevent conflicts

The snippet will let you either link a script with a handle previously registered using the wp_register_script() function, or provide this function with all the parameters necessary to link a script.

Source: WordPress Codex

Photo Credit: Flickr/hackNY.org

Page 2 of 4

Powered by WordPress & Theme by Anders Norén