how to inject html code into wordpress head

Question, how to inject html code into wordpress head section If you don’t want plugin then use code snippet for inject the code into wordpress head section.

how to inject html code into wordpress head

Many wp developers asked me same question multiple times. How to push the some HTML code into the wordpress head section. It is quite easy to push or inject the the some HTML code into the head section.There are multiple WP plugins which are giving this facility the push the HTML code into the head section. If you don’t want to use the WP plugin then you can use my code snippet for inject the code into wordpress head section.

If you are WP theme developer then you can use following code.

 function WPAPI_init() {
echo "YOUR_HTML_GOES_HERE";
if (is_admin()) {
echo "YOUR_HTML_GOES_HERE";
}
 }
 add_action('wp_head', 'WPAPI_init');

You need to put above code into functions.php file which you find in themes folder.

If you are WP plugin developer then you can put above code into your plugin file.

wordpress plugin nextgen gallery review

we written wordpress plugin nextgen gallery review. NextGEN Gallery most downloaded gallery plugin which makes us to organize your images and galleries.

NextGEN Gallery is a most downloaded wordpress gallery plugin which makes us to manage and organize your images and galleries. There are many wordpress gallery and sideshow plugins but nextgen gallery is most used and popular in wordpress world. In every second website we need to show the gallery or sideshow. For showing gallery or sideshow, Nextgen gallery is quickest and simple solution. Every wp designers and developers first choice for gallery or sideshow is Nextgen gallery plugin.

wordpress plugin nextgen gallery review

NextGEN Gallery

wordpress plugin nextgen gallery review  by purabtech.in
wordpress plugin nextgen gallery review

NextGEN Gallery is the most popular WordPress gallery plugin, and one of the most popular WordPress plugins of all time, with over 7.5 million downloads.

It provides a powerful engine for uploading and managing galleries of images, with the ability to batch upload, import meta data, add/delete/rearrange/sort images, edit thumbnails, group galleries into albums, and more. It also provides two front-end display styles (sideshows and thumbnail galleries), both of which come with a wide array of options for controlling size, style, timing, transitions, controls, lightbox effects, and more.

Review:

Pros:

  • Very easy to install in wordpress and using Nextgen gallery is simple.
  • Simple and easy gallery management tools – It has simple image upload and gallery creation interface.
  • It works with custom post type very smoothly
  • Support of short codes so you can easily integrate anywhere in wp site
  • Easily create sideshow through NextGen gallery
  • Many types of effects and JS support using multiple plugins
  • There are many wordpress plugins which can adds effects to gallery or sideshow.
  • If you are wordpress developer then you can easily customize the plugin and add the new effect.
  • We can use Lightbox Plus, FancyBox and Lightbox-type wordpress plugins for gallery and sideshow.

Drawbacks:

  • We cannot include videos in gallery or youtube video in gallery
  • After upgrade of Nextgen gallery you must need to take backup of whole system because many times it will broke your website.
  • WordPress new version release issue – After new wordpress release, there is no guarantee to it will work in Nextgen gallery.
  • It consumes too much processor and so many database queries are fired on server.
  • Poor logic programming, poor user interface, slow user interface, lot’s of queries are just some of the many bugs and bad design of application
  • Performance is low it there are too many requests
  • No caching support.
  • No SEO support

Comments:

If you have high traffic website then do not use the nextgen gallery plugin. If you have low traffic or any organization website then you should go for Nextgen gallery plugin.

There are so many supported plugins for Nextgen gallery, so you can add multiple effects using this plugin.

I used Next Gen gallery plugin for many of my sites. But there is always issue with up-gradation.

But SEO wise this plugin is not so nice.

best wordpress seo plugins ever which will increase site seo

Normally people searching for best wordpress seo plugins,  I shortlised best wordpress seo plugins which are really useful for every wordpress developers.

I am using wordpress since 2006 for my blogs and websites. Since I also written the wordpress plugins for SEO purpose. Still some wordpress plugins are really doing great work. SEO is very import facter for every website.

best wordpress seo plugins

I almost used every best wordpress seo plugins But I like following wordpress plugins due to some reasons. Personally I like the “WordPress SEO by Yoast” wordpress plugin for SEO purpose. It is simple to use. It is not impacting on your site performance. It takes less then 40% memory as compare the other seo plugins. Site performance is very for every website seo. Meta description and meta tags and seo title are equally important.

Smart WordPress SEO

Boost your wordpress SEO: Full SEO features Meta Tags, webmaster tools settings, Social AuthorShip for Facebook, Twitter and Google Plus and XML sitemap

You can enter your meta keywords and description for your homepage and each post and pages.

This plugin will add different Meta description for each individual post as your excerpt of your post.

This will help your blog to rank better in google. You can easily increase your blog traffic using this plugin.

Following are the features:

  1. Preview of Smart wordpress SEO – Home page Keywords and description
  2. WebMaster Tool Verification Setting
  3. Social Authorship for Google, Twitter and Facebook
  4. XML sitemap setting
  5. Image SEO setting
  6. Eash Post or Page SEO title, Description and Keywords setting

WordPress SEO by Yoast

best wordpress seo plugins ever which will increase site seo
best wordpress seo plugins ever which will increase site seo

Improve your WordPress SEO: Write better content and have a fully optimized WordPress site using the WordPress SEO plugin by Yoast.

Comments: This is very nice plugin for SEO. It takes less memory as compare to other best wordpress seo plugins. I personally using this plugin in my site. This plugin has not many features like other best wordpress seo plugins but this plugin is really fast. No memory leak issues with this plugin.

SEO Ultimate

SEO Ultimate,best wordpress seo plugins
SEO Ultimate,best wordpress seo plugins

This all-in-one SEO plugin gives you control over title tags, noindex, meta tags, Open Graph, slugs, canonical, autolinks, 404 errors, rich snippets,

Comments: I love this plugin. This plugins I used for years. If you have good hosting solution then you should go for this plugin for seo. This is best ever and great plugin for seo. But only bad part is It takes lot of memory of your site almost 30% of memory will consumed by this plugin while each page loading. Still I can recommend this plugin for SEO because It has really great result in SEO with wordpress.

All in One SEO Pack

All in One SEO Pack,best wordpress seo plugins
All in One SEO Pack,best wordpress seo plugins

WordPress SEO plugin to automatically optimize your WordPress blog for Search Engines.

Comments: This plugin is really oldest great seo tool for wordpress. This plugin I used for some time. It has great features. Helpful to SEO. Many bloggers are still loving this wordpress plugin and using it. This plugin also consume your server memory big time while each page loading. Performance is  very important when you are using any wordpress plugin.

My SEO Plugin

Seo Meta Tags

You can enter your meta keywords and description for your homepage. Same like best wordpress seo plugins, this is also great and simple and very light seo plugin which is written by me.
This plugin will add different Meta description for each individual post as your excerpt of your post. This will help your blog to rank better in google. You can easily increase your blog traffic using this plugin.

Comments: This plugin has minimal features for SEO but still most important seo features are present in this plugin. This plugin will not consume your site memory. This plugin is super fast. This plugin is very easy to use in your site. They looked for performance of site. Using this plugin you can increase the seo without effecting the site performance.

What People are doing for SEO

Normally people are searching for best wordpress seo plugins, install wordpress seo plugins,  all in one seo wordpress plugin, wordpress seo optimization, yoast seo, wp seo plugin, all in one seo vs yoast,  seo ultimate vs yoast. I shortlised the best ever wordpress seo plugin which are really useful for every wordpress developers. If you have doubts about wordpress SEO then you can write to me.

add google plus button to wordpress without plugin

Many people asking me how to add the google plugin button in wordpress without plugin. WordPress tutorial for, add google plus button to wordpress without plugin. You can easily add the google plus button counter to your wordpress website.

add google plus button to wordpress without plugin

I added the google button code to digcms.com site.

You just need to add the following code to site.


<!-- Place this tag where you want the +1 button to render -->
<g:plusone size="tall"></g:plusone>

<!-- Place this render call where appropriate -->
<script type="text/javascript">
 (function() {
 var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
 po.src = 'https://apis.google.com/js/plusone.js';
 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 })();
</script>

For getting the different style of google plus button you can go to following site.

http://www.google.com/webmasters/+1/button/

add google plus button to wordpress without plugin
add google plus button to wordpress without plugin

Add feedburner email subscription wordpress without plugin

WordPress tutorial for, Add feedburner email subscription wordpress without plugin. We given full detailed explanation with screenshot and steps for adding feedburner email subscription wordpress without plugin.

Many blogger and people want to add the feedburner RSS feed email subscription form in their website.

Add feedburner email subscription wordpress without plugin

What is RSS?

The easiest way to receive latest posts from your favorite blogs is to subscribe to RSS using feed readers such as Google Reader, Bloglines, NetVibes.
RSS (means Really Simple Syndication) retrieves the latest content from the sites you are interested and pulls them into your feed reader where you can read them all in one location rather than visiting each site separately.

What is FeedBurner?

Most blogs have RSS feed which is detected automatically by commonly used feed readers when the blog URL is added to the reader.

 

Setting Up Your Feedburner Feed

1.  Go to Feedburner and sign in to Feedburner with your Google Account (create a Google Account first if you don’t have one!).

However, if you want to make it more obvious and easier for readers to subscribe using RSS, or want to know exactly how many people subscribe to your blog then the best option is to add a Feedburner RSS feed and email subscription to your blog.

 

After creating feedburner account go to

1.  Click on the Publicize Tab > Email Subscription in your Feedburner account and click on Activate.

2.   Copy the HTML code.

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

 

After this go to wordpress admin panel and go to widget section and choose text widget.

Add a text widget to the desired sidebar by dragging it from the Available Widgets into the Sidebar area on the right.

The widget will automatically open — just add the HTML code for Feedburner email subscription, click Save and then Close.

 

This widget will look as follows:

Add feedburner email subscription wordpress without plugin
Add feedburner email subscription wordpress without plugin

If you like this article then please subscribe my blog.

register activation hook using in wordpress plugin

wordpress hooks are very important for wp developers. We can use the wp hooks in wordpress plugin and themes. Here in this article I will show you how to register the hook in wordpress plugin. I given the simple code sample which will give you the fare idea about using the wordpress hooks.

register activation hook using in wordpress plugin

register activation hook using in wordpress plugin
register activation hook using in wordpress plugin

register_activation_hook is very important function for creating the wordpress plugin. The function register_activation_hook registers a plugin function to be run when the plugin is activated.
You can use the register_activation_hook as follows:

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php register_activation_hook($file, $function); ?>

If you can going to create the wordpress simple plugin then this function is very useful. this function you can use as follows in files.
If you have a function called myplugin_activate() in the main plugin file at either

* wp-content/plugins/myplugin.php or
* wp-content/plugins/myplugin/myplugin.php

you can use code as follows:

global $myvar;
$myvar='whatever';

function myplugin_activate() {
  global $myvar;
  echo $myvar; // this will be 'whatever'
}

register_activation_hook( __FILE__, 'myplugin_activate' );

1. register_activation_hook() must be called from the main plugin file – the one that has “Plugin Name: …” directive.
2. Your hook function must be in the same file as well. From that function it is ok to call other functions defined in other files.
3. Doing echo “My hook called!”; – does not work from it. So this is not a good way to judge whether it working or not.
4. Your global variables must be explicitly declared as global for them to be accessed from inside of my_activation_hook().

Check the sample wordpress plugin code.

<!--?<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->php
/*
Plugin Name: A Test
Description: A Test
*/

require_once (dirname(__FILE__) . '/my_other_file.php');

// This code *will not* work. Activation hook function must be defined in the main plugin file.
//    register_activation_hook (dirname(__FILE__) . '/my_other_file.php', 'my_other_function');

// This code will work.
register_activation_hook (__FILE__, 'test_activated');

// This is correct way to declare/access globals.
global $some_var;    // globals must be declared explicitly. Without this you will not be able to access '$some_var' from within 'test_activated()' function.
$some_var = 'hey';

//===========================================================================
function test_activated ()
{
   global $some_var; // Now it will be 'hey'.

   // This function is defined in 'my_other_file.php'
   my_other_function ();

   // This will not work, so don't try. If you need logging write something in temporary log file in here via fopen/fwrite.
	// If you want to quickly test if your activation hook works - put exit() into it. At least you'll see error during activation.
   echo 'test_activated called!';
}
//===========================================================================

?>

The function register_deactivation_hook registers a plugin function to be run when the plugin is deactivated.
following function will deactivate your plugin

register_deactivation_hook( __FILE__, 'myplugin_deactivate' );

wordpress comments captcha plugin

we got around 4000 spam comments daily. Spam comments are increasing daily. when we fed-up these comments, we deiced to use the Akismet plugin. That is not enough. So Here is a list of unique and best wordpress comments captcha plugin

wordpress comments captcha plugin

wordpress comments captcha plugin
wordpress comments captcha plugin

I recomend to use the capcha plugin for protecting from spam comments. I like the wp-recaptcha wordpress plugin and I recommend to use that plugin.

Here are some very nice wordpress capcha plugins for wordpress comments.

WP-reCAPTCHA

reCAPTCHA is an anti-spam method originating from Carnegie Mellon University which uses CAPTCHAs in a genius way. Instead of randomly generating useless characters which users grow tired of continuosly typing in, risking the possibility that spammers will eventually write sophisticated spam bots which use OCR libraries to read the characters, reCAPTCHA uses a different approach.

Raz-Captcha

Prevent registration spam and bots login by adding custom captcha tests in the registration page and/or login page

Featuring 5 different and customizable captcha algorithms with possibility to set your own random characters font, styles, colors background and more
For a working demo se login and register pages from the author home page

Simple CAPTCHA

A CAPTCHA for your comment system to prevent unwanted spams. Prevent automated spams by bots and most important naughty peoples. It’s simple and yet secure.

WP Captcha-Free

WP Captcha-Free blocks automated comment spam without resorting to CAPTCHAs. It does so by validating a hash based on time (and some other parameters) using AJAX when the form is posted. Comments posted via automated means will not have a hash or will have an expired hash and will be rejected. Unlike using a captcha, this does not place any burden on the commenter.

CAPTCHA-Godfather

This plug-in protects the form for posting comments from spam by 4 ways; CAPTCHA code, Session ID (which is different from PHPSESSID), Timestamp, IP Address. Also allows the webmaster to choose between fonts.

Security Captcha

Prevent registration spam and bots login by adding custom captcha tests in the registration page and/or login page

SI CAPTCHA Anti-Spam

Adds CAPTCHA anti-spam methods to WordPress on the comment form, registration form, login, or all. In order to post comments or register, users will have to type in the code shown on the image. This prevents spam from automated bots. Adds security. Works great with Akismet. Also is fully WP, WPMU, and BuddyPress compatible.

How to add pagination in wordpress

Many times adding the custom pagination in wordpress blog is very important. Adding custom pagination in wordpress blog is good. In this article, we will show you, How to add pagination in wordpress with plugin and without wp plugin

How to add pagination in wordpress

  • Simple WordPress Default pagination

You need to open the your index.php file from wordpress theme and put following code in that file.

<div class="navigation">
<div class="alignleft"><?php next_posts_link('Previous') ?></div>
</div>
<div class="alignright"><?php previous_posts_link('Next') ?></div>

If you want the pagination in single post then you can use the following code:

<?php next_posts_link($label , $max_pages); ?>
<?php prev_posts_link($label , $max_pages); ?>

More pagination style visit above URL: wordpress pagination style without wordpress plugin

There are some very nice wordpress plugin available for wordpress pagination.

How to add pagination in wordpress
How to add pagination in wordpress

PageNavi wordpress plugin is really nice. I personally like this plugin so much. With this plugin you can apply your custom css also.

  • Changing the CSS

If you need to configure the CSS style of WP-PageNavi, you can copy the pagenavi-css.css file from the plugin directory to your theme’s directory and make your modifications there. This way, you won’t lose your changes when you update the plugin.

Alternatively, you can uncheck the “Use pagenavi.css?” option from the settings page and add the styles to your theme’s style.css file directly.

how to insert php code in wordpress post

Some time we need to execute and use the php code in wordpress post and page. There is solution for inserting the php code in to wordpress post.

how to insert php code in wordpress post.

 

how to insert php code in wordpress post
how to insert php code in wordpress post

I found very useful wordpress plugin for that. But my advise is don’t use this plugin ever try to put your php code as possible in wordpress theme.

Exec-PHP

The Exec-PHP plugin executes PHP code in posts, pages and text widgets.

Features:

  • Executes PHP code in the excerpt and the content portion of your posts and pages
  • Configurable execution of PHP code in text widgets (for WordPress 2.2 or higher)
  • Write PHP code in familiar syntax, eg. php ... ?>
  • Works in your newsfeeds
  • Information about which users are allowed to execute PHP with the current security settings (for WordPress 2.1 or higher)
  • Configurable user warnings for inappropriate blog and user settings (for WordPress 2.1 or higher)
  • Restrict execution of PHP code in posts and pages to certain users by using roles and capabilities
  • Update notifications through the ‘Plugins’ menu in WordPress if a new version of the Exec-PHP plugin is available (for WordPress 2.3 or higher)
  • Internationalization support (english and german included, many more available)
  • Comes with documentation

Inline PHP

The plugin can execute php string in posts/pages, and display the output as the contents of posts/pages. Just quote what you want to execute in <exec>...</exec> or [exec]...[/exec] tag.

You can put the php code in post following way.

       $filestr = file_get_contents('http://www.seocompany.ca/pagerank/page-rank-update-list.html');
       if (preg_match('/</pre>
.*<\/p>/ums', $filestr, $matches)){
           echo str_replace("

<a href="\&quot;#page-rank-update-list-history\&quot;">Top of Page Rank Update List History</a>
<pre>", "", str_replace("", "", $matches[0]));
       }
   

code syntax highlighter through wordpress plugins

When ever we write some code in post. That code need to visible very easily. Here are some code syntax highlighter through wordpress plugins which will be useful for developers and coders. There are some useful wordpress plugins for highlighting the code in wordpress post.

code syntax highlighter through wordpress plugins
code syntax highlighter through wordpress plugins

 

code syntax highlighter through wordpress plugins

While WordPress.com doesn’t allow you to use potentially dangerous code on your blog, there is a way to post source code for viewing. We have created a shortcode you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages, like so:

To accomplish the above, just wrap your code in these tags:

 your code here
 

The language parameter controls how the code is syntax highlighted. The following languages are supported:

  • actionscript3
  • bash
  • coldfusion
  • cpp
  • csharp
  • css
  • delphi
  • erlang
  • fsharp
  • diff
  • groovy
  • javascript
  • java
  • javafx
  • matlab (keywords only)
  • objc
  • perl
  • php
  • text
  • powershell
  • python
  • ruby
  • scala
  • sql
  • vb
  • xml

If the language parameter is not set, it will default to “text” (no syntax highlighting).

Code in between the source code tags will automatically be encoded for display, you don’t need to worry about HTML entities or anything.

There are some free plugins also helpful for syntax highlighting.  I specially like the SyntaxHighlighter Evolved wordpress plugin. SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without loosing it’s formatting or making any manual changes.

You can download this plugin form here:

SyntaxHighlighter Evolved

There is another plugin for syntax highlighting which also really nice.

WP-Syntax provides clean syntax highlighting using GeSHi — supporting a wide range of popular languages. It supports highlighting with or without line numbers and maintains formatting while copying snippets of code from the browser.

It avoids conflicts with other 3rd party plugins by running an early pre-filter and a late post-filter that substitutes and pulls the code snippets out first and then pushes them back in with highlighting at the end. The result is source code formatted and highlighted the way you intended.

You can download the this from here:

WP-Syntax