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

Category: Snippets Page 12 of 14

Snippets

Very Useful 10 WordPress Hacks

WordPress

Whether it’s WordPress hosting providers, designers, developers and lots other who have been involved with WordPress, every new day, a different useful hack will make a day for all. But what essential, does the hack is just like normal sting of lines or something more. Possibilities are many – really much and more – but unless and until one got the right one at place, nothing makes a complete sense. In this article to bridge the gap, I have collected 10 of very useful WordPress hacks.

#1 How to insert ads every two posts in WordPress

It is said that ads inserted on the content perform better than those on sidebars or footers. Let’s see a quick and easy technique for WordPress to display ads every two posts.

In order to do this, we need to initialize a variable before entering The Loop and, during the iteration through the posts, test if its value is even. We will use the Modulus operator %, which in an operation

[Visit The Site For Complete Hack]

#2 Easily navigate pages on your dashboard

If like me you use WordPress as much as a content management system then this plugin will place a widget on your dashboard that lets you navigate through your pages as though it was windows explorer.

[Visit The Site For Complete Hack]

#3 How To Add A Google Buzz Share Button

In this simple tutorial, we will teach you how to integrate Google Buzz button which opens in same window and has a close button too at top right hand side. This also picks the post excerpt automatically.

[Visit The Site For Complete Hack]

#4 How To Display Twitter counter in Text

Display Twitter Counter in Text is easily in WordPress with PHP code, all need to do just write down some PHP Script in our wordpress theme, we can write it on sidebar.php, footer.php, header.php or whatever we want to put on.

[Visit The Site For Complete Hack]

#5 Using a WordPress Page as Your Home Page

It’s not only possible it’s relatively easy. The first step is to create a page to serve as your new home page. For the purpose of this example, we’ll call it “My New Home Page.”

[Visit The Site For Complete Hack]

#6 Show Adsense Only to Search Engine Visitors

As we all know that regular visitors don’t click on ads, around 90% folks who click on ads are coming from search engines.

Also for fact that Google pays more if your click-through rate (CTR) is higher, Google’s “smart pricing.” Being smart priced means that your click-through rate (CTR) is low and the money you earn per click is divided by between 2 and 10. For example, if a click would normally earn you $1.00, with smart pricing it could earn you as little as $0.10. Painful, isn’t it? Happily, this solution displays your AdSense ads to search engine visitors only, which means more clicks and a higher CTR.

[Visit The Site For Complete Hack]

#7 Image Decoration and Optimization Tutorial in WordPress

The reason in-post image decoration is important is because many WordPress sites have large collections of images, but they lack simple image size handling and other basic functionality. We’ve all seen blogs where the images overlap with text, or expand beyond the border of the design.

[Visit The Site For Complete Hack]

#8 Show Category Images

I’m going to show you how to add some simple PHP code to your WordPress template and make linked images appear instead of text for your categories in posts. All you need to know is simple PHP, some basic HTML, and how to make your own graphics.

[Visit The Site For Complete Hack]

#9 RSS Footer

This very simple plugin let’s you add an extra line of content to articles in your feed, defaulting to “Post from: ” and then a link back to your blog

[Visit The Site For Complete Hack]

#10 A better WordPress tag cloud

A bit of copy & paste code that will make your WordPress tag clouds better looking and better performing.

[Visit The Site For Complete Hack]

Photo Credit: Flickr/Heisenberg Media

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

Black Friday And Cyber Monday 2013 WordPress Deals

WordPress

We are into that time of the year where we want more deals as compared to any other day. No matter even if different sales go year around, but the one we love more are the Black Friday and Cyber Monday deals. Well, celebrating both these days the same way this year, we have collected different available deals, discounts and coupons available out there which on choosing can help you make it BIG for your next WordPress website or a blog.

Featured Deals

#1 Get Your Product Speedy Review Done By JustWP.org – only $69!

Is your product the Next Big Thing? Wanna have the whole of world heard what you are coming up with via our website? We are offering a Black Friday / Cyber Monday Offer to you that we will review your product (plugin/themes/service/anything related to WordPress) for $69 instead of our regular price of $99. The offer is valid only till December 03, 2013. [More Info; the produce we reviewed will get syndicated to AllTop, ManageWP.org, Paper.li, PaperBlog and more, means ordering the service will get you an XTRA PACKAGE BENEFIT of knowing by more people at par]

Just make sure when you order, then put up BLACKFRIDAY before putting up your product description. To order, simply fill up the form by clicking here.

#2 3 WooCommerce Themes from Tokokoo – only $19!

It includes 3 gorgeous multipurpose WooCommerce Themes for your website. No matter what kind of store you want, it includes a variety of options and customizations to make your corner of the Internet stand out from your competition! [More Info]

#3 Gorgeous Premium WordPress Theme Bundle from Rockable Themes – only $19!

Get gorgeous premium WordPress theme bundle under the deal. [More Info]

#4 Choose ANY 2 Themify Themes only $19!

Themify is offering a special deal: buy one WordPress theme for $19 and get a second one free. [More Info]

#5 WordPress Advertising Plugin – only $24!

Pop a couple of aspirin for the headache and then get yourself a copy of WP AdCenter, a mega-powerful advanced plugin for WordPress that will handle every single aspect of advertising on your site. [More Info]

#6 40% Off On All Magazine 3’s themes

40% off on all themes & all licenses. Simply put up the coupon code DISCOUNTMADNESS2013 at the time of purchase. Valid till December 2nd, 2013 [More Info]

More Deals

#1 10 One-Page Bootstrap Themes from DX Themes – only $10!

Not only will you get 10 gorgeous professional one-page themes from DX Themes, but you’ll also get a chance to use super fast and simple-to-customize themes! All the themes included in this bundle are built on the Twitter Bootstrap framework. [More Info]

#2 40 Fantastic Landing Pages PSD Templates – only $17!

From basic landing pages to 404 error pages to sign-up forms, this high-quality collection of 40 premium landing page PSD templates is all you need to take your website to the next professional level. [More Info]

#3 5 PitchStock PowerPoint Presentation Decks – only $17!

PitchStock offers up 5 Unique Pitch Decks to work off of! With 15 slides each, and two different screen-ratios to choose from, you’ll be having your clients eating out of the palm of your hand in no time! [More Info]

#4 22 Quality Bootstrap 3.0. Themes from Bootstraptor – only $27!

You’ll get 22 gorgeous themes! That’s 22 incredible new ways to show off your amazing site. You’ll retain the same amazing organization and site speed, but gain an entirely new and exciting look. [More Info]

#5 20 Premium Bootstrap Templates from Flashmint – only $19!

Deal from Flashmint, you’ll get 20 different Bootstrap templates to work with. That’s 20 faster and more powerful HTML templates at an incredible fraction of their original price. [More Info]

#6 125 Gorgeous Apple Mail Stationery Templates – only $9.97!

If you use Apple’s Mail program to send your emails, however, you can still have that old-school stationery feel but with today’s modern technology! With this deal you will get 125 High Quality Apple Mail Templates from Jumsoft! [More Info]

#7 Ultimatum 2.5: The Ultimate WordPress Theme Builder – from $35!

The Ultimate WordPress Theme Builder from Ultimatum [More Info]

#8 10 Premium Responsive Bootstrap Templates – only $10!

A collection of 10 HTML5/CSS3 Bootstrap responsive templates all ready for you to integrate into your glorious website. [More Info]

#9 10 Fresh Responsive WordPress Themes – only $19!

Whether you need to switch to a responsive theme or already have a responsive WordPress theme and want to change things up, this deal from Flashmint is one worth responding to! [More Info]

#10 10 Professional Facebook Page Templates – only $17!

Get 10 Professional Facebook Page Templates from Fan FBML Templates [More Info]

#11 32+ Responsive WordPress Themes from WP Triumph – only $27!

This collection of premium responsive WordPress themes from WPtriumph offers a large selection of high-quality, easy-to-use themes that are sure to give your blog the treatment it deserves. [More Info]

#12 205 Killer Photoshop Actions – only $17 (regularly $238!)

From PhotographyPla.net comes a massive Photoshop Action Set Bundle! [More Info]

#13 SlickGallery: An Elegant Photo Gallery Script – only $14!

An elegant photo gallery script from SlickGallery [More Info]

#14 High-Quality Stock Photos with Extended License – only $0.47/photo!

Through this deal, you can purchase a preselected set of either 50 or 100 high-quality stock photos at a fraction of their regular cost. [More Info]

#15 App UI Kit: 300+ Elements in 60+ PSDs & Bonus Material – only $8!

This impressive Mighty Deal from the fine folks over at Graphics Fuel is a magnificent collection of over 300 elements for an iOS7 or Android app design. Insanely organized, fully customizable, and available in three different visual styles, this App UI Kit can help turn a new user into a loyal one. [More Info]

#16 100 Colorful Grunge Textures from Florin Gorgan – only $12!

Consisting of 100 colorful grunge textures, by Florin Gorgan, this collection will let you easily alter the appearance of any photo you’d like. [More Info]

#17 1,500+ John Forsythe’s Professional Photoshop Text Effects – only $19!

The collection of more than 1,500 high-quality text effects from John Forsythe [More Info]

#18 10 Professional Cartoon Characters in 400+ poses – only $24!

The collection of over 400 professional cartoon character illustrations [More Info]

#19 Logo Bundle: 50 Customizable Logo Templates – only $29!

Whether you’re handling the logo yourself or you’re putting something together for your clients, you can save a tremendous amount of time and money by taking advantage of this Logo Templates Bundle from Vandelay Premier which offers you a wide variety of options at one incredibly low price. [More Info]

#20 700+ Professional Web Backgrounds – only $29!

With this incredible deal from Designersfolder, you’ll get over 700 Web Backgrounds to play with! [More Info]

#21 1,500 Royalty Free Vector Icons – only $35!

Inventicons is giving you 1500 royalty-free icons, available through this deal for half off the regular price of $70 – only $35! [More Info]

#22 1,500 Gorgeous Hand Drawn Vector Icons – only $35!

A huge collection of hand-drawn vector icons from Inventicons. [More Info]

#23 Jollycons! 400 Fun Hand-Drawn Vector Icons – only $14!

A fantastic collection of 400 hand-drawn vector icons at a whopping 50% off the already low price! [More Info]

#24 Bundle of Bundles! 2,500 Vector Icons – only $37!

A total of 2,500 vector icons [More Info]

#25 SuperPlugins – Get 30% off On Everything in Your Cart

Get 40% off on SuperPlugin’s Power Widgets, Login Widget Pro, W2Z, W2Z and G2T Plugins’ by simply putting up the coupon code blackfriday [More Info]

Photo Credit: Flickr/Erik (HASH) Hersman

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

WordPress Snippets That You Don’t Want To Miss

Computer Program -4

NO Follow WordPress Tag Cloud

The following snippet will result in no following WordPress Tag cloud. All you have to do is to add the snippet to your theme’s functions.php.

Expire Protected Post Cookie With Session

You need to set the time of 0 in setcookie() to your theme’s functions.php template. Setting the time will let you forces the cookie to expire the session.

Source: Drew Jaynes

Display avatar for currently logged in user with get_avatar

The snippet will let you display the currently logged in users avatar in your theme.

Prevent access to wp-admin

Adding this snippet to your functions.php will redirect subscribers away from wp-admin to the home page.

Source: Flowdrops.com

Hide login errors

The code will disable the login errors that are displayed to users.

Page excerpt

The snippet will add excerpts for pages. All you require is to place the following code in your themes functions.php file and you are done.

Reset your password

This would be a biggest nightmare for you if not able to reset your password especially when you can’t use the “forgot password” function. Insert this snippet into a phpMyAdmin Sql-window.

Image Custom Field

If you want to call the custom field for an image source, then use the following snippet.

Add a Dashboard Widget

As soon as you login into your WordPress Dashboard, the first thing you will notice that it has been filed with number of widgets. Using this code will allow you to add your own widgets, just add this code to functions.php.

Photo Credit: Flickr/hackNY.org 

Must Required WordPress Snippets

The Scheme Programming Bee

Prevent WordPress to compress your jpg images

Adding the following code to your functions.php file will let WordPress prevent to compress your jpg images.

Source: WP-Snippets

Embed a page into another page

Paste the code below within the loop. And you will be able to embed a page into another page.

Source: CSS Tricks

Add extra contact methods to user profiles

Just paste the following code into your function.php file and you will be able to add extra contact methods for your user profiles.

Source: TutsPlus

Use shortcodes in theme files

The following snippet will allow you to use shortcodes in theme files.

Source: WP Snippets

Speed up your blog by caching custom queries

Simply paste the following code where you need to execute a custom query to the database and you will be able to speed up your blog by caching custom queries.

Source: WordPress Codex

Show admin bar only for admins

Simply paste the following code into your functions.php file and you will be able to show admin bar only for admins.

Source: Jeff Starr

Display number of Facebook fans in full text

Simply paste the following code, where you want your Facebook fan count to be displayed.

Source: WP Snippets

Restrict user access to specific templates

Simply create a new page template and paste the following code and you will be able to restrict user access to specific templates.

Source: Kevin Chard

Photo Credit: Flickr/Jeff Dlouhy

10 Essential WordPress Snippets

Programming

Adding Shortcuts to WordPress toolbar

Adding the following short code into your functions.php file will let you add shortcuts to your WordPress toolbar.

Source: Jeff Starr

Display pingbacks/trackbacks count within admin post columns

Adding the following code in your functions.php file will let you display pingbacks/trackbacks count within admin post columns.

Source: InstantShift

Easily embed and share Github gists

Source: Robert O’Rourke

Create a custom database error page

You often noticed the error “Error establishing a database connection.” Well the idea with this short code is to create a custom database error page. Copy and paste the code below in a new file name as db-error.php and save it on your wp-content directory and you are done.

Source: CSS Tricks

Add a “delete” button to WordPress admin bar

The following short code will let you add a “delete” button to WordPress admin bar. All you have to do is to copy and paste the code in your theme’s functions.php file.

Source: WPEngineer

Displaying RSS Feed

Adding the following code will let you display RSS feeds on your WordPress blog.

Source: Dan Gayle

Automatically create meta description from content

On pasting the following code into your functions.php file, it will let you create meta description from content automatically.

Source: Paul

Testing if a plugin is active or not

The following short code will let you track that whether the plugin is active or not.

Source: Cats Who Code

Change the “posts” label to “articles”

Open your functions.php file, paste the code and you will be able to change the “posts” label to “articles.”

Source: Smashing Magazine

WordPress pagination without plugins

Simply add the code to the place where you want to display your pagination and you are done.

Source: Smashing Magazine

Photo Credit: Flickr/mendhak

5 Useful WordPress Snippets

Programming

Display information about your multisite install

To display information about your multisite install, simply paste the following piece of code where you want the info to be display.

Source: Kevin Leary

Automatically remove p tags on images

Simply paste the following code on your theme functions.php file, save it, and the <p> tags are gone permanently.

Source: James

Automatically email guest authors when their posts are published

Copy the code below and paste it on your functions.php file and you will be able to automatically email contributors when their posts are published.

Source: Daniel Pataki

Create a login form shortcode

Paste the code below into your functions.php file which lets you create a login form shortcode for your WordPress blog.

Once done, add the following shortcode on the page where you want to have the login form added.

Source: DevPress

Reduce spam by using .htaccess

Simply paste the following lines into your .htaccess file but also make sure you do take the backup of the whole of your website before putting this shortcode.

Source: AllGuru.net

Photo Credit: Flickr/Mike Renlund

‘Must’ Required WordPress Snippets

While to help you out in numerous issues revolving all around your WordPress blog, there are hundreds of thousands of plugins available out there, but still what, one definitely need something more. If you have a little (fine) or intermediate (good) or an expert (perfect) knowledge of playing with codes, then the short codes (also known as snippets) will help you ease your job while dealing with issues surrounding your blog. In this article, we have collected such ‘must’ required WordPress snippets. Hope they will be useful for you.

Code

Prevent posts from a particular category to be displayed in WordPress loop

Often times come when you want to exclude certain category of posts from display on the WordPress loop. For excluding such categories, all you have to do is just copy and paste the code below into your functions.php file. But make sure you need to update the code with category ID you want to exclude on line 4.

Source: David Walsh

Search within a specific post type only

The following code will allow you to search only within a specific post type. Just copy and paste the snippet in your theme functions.php file and simply update the code with your post type name on line 4 and you are done.

Source: Hongkiat

Prevent WordPress from asking FTP credentials

Paste the following line in your wp-config.php file and you will be able to prevent WordPress from asking you yours site FTP credentials. The wp-config.php file is located in the root of your WordPress install.

Source: WP Tuts+

Secure your WordPress blog uploads directory

Adding the following code to your newly created file named .htaccess will let you secure your WordPress blog upload directory. The code will let only accept images files, while if in case you want to add any other file type, then make sure you add the file extension to the list on line 5.

Source: Jeff Starr

Easily get post content by ID

You often need to get the content or title from a specific post. The following code will display the content of the post with id $post_id.

Source: WordPress Codex

Display a custom message on WordPress registration page

You often like to display a custom message on your registration page. For doing this, all you have to do is paste the code below in your functions.php file with updating your message on line 6.

Source: Kevin Chard

Empty trash on a daily basis automatically

Simply open your wp-config.php file and add the following line of code and you will notice that WordPress automatically empty the trash on daily basis.

Photo Credit: Flickr/Lindsey Bieda

Page 12 of 14

Powered by WordPress & Theme by Anders Norén