Search result is single than redirect to wordpress post

Users always use the search the keywords in wordpress sites. Many times clients wish about this functionality. If there is only one result came from search result than user should redirect to single landing post.

Search result is single than redirect to wordpress post

If there is Search result is single then redirect to wordpress should redirect to single landing post.

You should open the functions.php file and  put following code in functions.php file.

<pre>add_action('template_redirect', 'redirect_single_post');
function redirect_single_post() {
    if (is_search()) {
        global $wp_query;
        if ($wp_query->post_count == 1) {
            wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
        }
    }
}
Search result is single than redirect to wordpress post
Search result is single than redirect to wordpress post

use animated smileys and emoticons in wordpress post

Smiles and emoticons are always important show your expressions in short way. Earlier also I posted articles about same. Here is link about that. here in this article written about animated smileys. I given very detailed information to use animated smileys and emoticons in wordpress. animated smilyes and emotions are used everywhere now in mobile device.

use animated smileys and emoticons in wordpress

By default wordpress supports some basic emoticons. Here I can suggest some very cool wordpress plugins.

Kaskus Emoticons

Kaskus Emoticons is an emoticon set inspired by Kaskus, the Largest Indonesian Community – consisting of over a million active members from all over the world. The images which are used in this plugin are copyright of Kaskus

Speedy Smilies

Speedy Smilies takes emoticons in WordPress to the next level (where it should be already and hopefully one day will). The end goal is to make smilies load faster in the browser for visitors and make them easy to insert into posts/pages for authors. In addition to the speed benefits, Speedy Smilies allows authors to easily change the appearance of emoticons using smiley sets.

Speedy Smilies is free software licensed under the GNU GPL version 3.

Tango Smileys Extended

Tango Smileys Extended (TSE) disables the built-in WordPress smileys and extends the number of available smileys from 18 to 202. The extended smileys can be input using standard emoticon shorthand, or through the CTI (Click to Insert) interface. Smileys in comments is supported and may be inserted using the standard emoticon shorthand or through the CTI interface. MCEComments is also supported.

This version of Tango Smileys Extended is for WordPress 2.8+
WordPress versions pre-2.8 are no longer supported. If you are using WordPress 2.7.x, please use Tango Smileys Extended 2.5.4.1. WordPress 2.6.x and earlier are only supported in versions of Tango Smileys Extended older than, and including, 2.5.2.8.

Moods Addon for Ultimate TinyMCE

This plugin is designed to be used as an add-on to my Ultimate TinyMCE plugin. However, it can also be used as a stand-alone plugin as well.

For best results; You can download Ultimate TinyMCE here:
http://wordpress.org/extend/plugins/ultimate-tinymce/

This addon will add a button to your visual tinymce editor for posts/pages. Clicking the button will open a popup window with over 50 professionally animated .gif smiley’s.

You can insert these smiley’s into your post/page content areas. Simply click a smiley, and it is automatically inserted into your content area.

Font Emoticons

Replaces WordPress’ smileys (based on images) with font-based emoticons (see screenshots). Font-based emoticons have some advantages:

  • They have the same size as the surrounding text. No more distorting the heights of lines containing smileys/emoticons. They always fit the font size.
  • They have the same color as the surrounding text.

The following emoticons are supported:

  • :) :-) :smile:
  • :( :-( :sad:
  • ;) ;-) :wink:
  • :P :-P :razz:
  • -.- -_- :sleep:
  • :thumbs: :thumbsup:
  • :devil: :twisted:
  • :o :-o :eek:
  • 8O 8o 8-O 8-o :shock: (No real icon for “shock” yet. Using “eek” instead.)
  • :coffee:
  • 8) 8-) B) B-) :cool:
  • :/ :-/
  • :beer:
  • :D :-D :grin:
  • x( x-( X( X-( :angry:
  • :x :-x :mad: (No real icon from “mad” yet. Using “angry” instead.)
  • O:) 0:) o:) O:-) 0:-) o:-) :saint:
  • :'( :'-( :cry:
  • :shoot:
  • ^^ ^_^ :lol:

Notes: * Emoticons must be surrounded with spaces (or other white space characters); e.g. the emoticon in that:)smile won’t be replaced * Emoticons won’t be replaced in HTML tags nor in <pre> or <code> blocks.

wp-Monalisa

wp-monalisa is the plugin that smiles at you like monalisa does. place the smilies of your choice in posts, pages or comments.

There are a lot plugins for smiley support out there and some of them are really useful. Most of them don’t work out of the box and this is what wp-monalisa tries to achieve, giving you the ability to maintain your smilies and even turn them into img tags.

it’s easy and it smiles at you…what else do you want?

Features:

  • maintain your smilies in a separate directory
  • activate or deactivate smilies for posts or comments
  • replace smilies with img tags
  • extend or replace wordpress smiley replacement
  • while edit posts or pages, pops-up in a draggable meta-box
  • extends your comment form to give you visitors the freedom to smile 🙂
  • support for fckeditor (tested with v3.3.1)
  • fully integrated ith BuddyPress
use animated smileys and emoticons in wordpress post
use animated smileys and emoticons in wordpress post

how to show author information on each wordpress post

show author information on each wordpress post is really good habit in wordpress post. So reader will know information writer who is writing the article. Many people like this information and they really read the information about author.

how to show author information on each wordpress post

how to show author information on each wordpress post
how to show author information on each wordpress post

For showing the author information you need put following code in the functions.php file show after your post content the author information will displayed to reader.


function get_author_bio($content=''){
global $post;

$post_author_name=get_the_author_meta("display_name");
$post_author_description=get_the_author_meta("description");
$html="</pre>
<div id="about_author" class="clearfix">\n";
$html.="<img class="avatar" src="http://www.gravatar.com/avatar.php?gravatar_id=&quot;.md5(get_the_author_email()). &quot;&default=&quot;.urlencode($GLOBALS[" alt="PG" width="80" height="80" />\n";
$html.="
<div class="author_text">\n";
$html.="
<h4>Author: ".$post_author_name."</h4>
\n";
$html.= $post_author_description."\n";
$html.="</div>
</div>
<pre>
\n";
$html.="</pre>
<div class="clear"></div>
<pre>
\n";
$content .= $html;

return $content;
}

add_filter('the_content', 'get_author_bio');

Just put the above code in functions.php file. You dont need to do code in single.php file.