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.
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.
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.
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.
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:
Preview of Smart wordpress SEO – Home page Keywords and description
WebMaster Tool Verification Setting
Social Authorship for Google, Twitter and Facebook
XML sitemap setting
Image SEO setting
Eash Post or Page SEO title, Description and Keywords setting
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.
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.
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.
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.
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.
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.
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.
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:
If you like this article then please subscribe my blog.
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 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:
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
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
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.
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.
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
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 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.
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.
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.
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.
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.
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="\"#page-rank-update-list-history\"">Top of Page Rank Update List History</a>
<pre>", "", str_replace("", "", $matches[0]));
}
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
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.
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.