How To Add Facebook and Twitter Button Into WordPress Post

March 5th, 2011 by oecilkritingz | Comments Off | Filed in Tips n Trik, Wordpress

Adding Facebook and Twitter Button Into WordPress Post

add facebook buttonThese days, most bloggers are using Facebook and Twitter to promote their posts. In today’s recipe, I’m going to show you how you are able to easily add Twitter and Facebook buttons to the bottom of your posts.

Thanks to Dev7Studios for this awesome recipe!

Paste the code below into your functions.php file, save it, and you’re done.

 

function share_this($content){
    if(!is_feed() && !is_home()) {
        $content .= '<div>
                    <a href="http://twitter.com/share"
class="twitter-share-button"
data-count="horizontal">Tweet</a>
                    <script type="text/javascript"
src="http://platform.twitter.com/widgets.js"></script>
                    <div>
                        <iframe
src="http://www.facebook.com/plugins/like.php?href='.
urlencode(get_permalink($post->ID))
.'&amp;layout=button_count&amp;show_faces=false&amp;width=200&amp;action=like&amp;colorscheme=light&amp;height=21"
scrolling="no" frameborder="0" style="border:none;
overflow:hidden; width:200px; height:21px;"
allowTransparency="true"></iframe>
                    </div>
                </div>';
    }
    return $content;
}
add_action('the_content', 'share_this');

 

Source:

Automatically add Twitter and Facebook buttons to your posts

http://www.wprecipes.com/automatically-add-twitter-and-facebook-buttons-to-your-posts

 

Tags: , , ,

How To Replace Words On WordPress Post

February 10th, 2011 by oecilkritingz | Comments Off | Filed in Tips n Trik, Wordpress

How To Replace Words On WordPress Post

replace words on wordpressJust like all we know, WordPress is actually promising publishing platform, it is totally free and simple for you to tweak or maybe installed new themes and also plugin. Or if we have small skills in PHP Programming we are able to enhanced our WordPress more easily.

On this example from WPSnipp, we will show (blank) How you can Replace Words in your WordPress posts effortlessly.

Replace Word on WordPress Content

This tutorial need to edit your functions.php, because this code do some add_filter to make it works.

All need to do, open your functions.php and paste this code.

function replace_text_wps($text){
   $replace = array(
        // 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS'
        'wordpress' => 'wordpress',
        'domain' => 'domain',
        'excerpt' => 'excerpt',
        'function' => 'function'
    );
    $text = str_replace(array_keys($replace), $replace, $text);
    return $text;
}

add_filter('the_content', 'replace_text_wps');
add_filter('the_excerpt', 'replace_text_wps');

On the code above using add_filter to filter the_content and the_excerpt. So all match words will be replace with the new parameter as described. That’s is, we hope this tutorial works on you.

Thanks Kevin Chard from WP Snipp for this code

Source:

How To Replace Words On WordPress Post

http://wptricks.net/the-best-way-to-replace-words-in-your-posts/

 

Tags: , , , ,

How to Limit Number of Search Results on WordPress

January 1st, 2011 by oecilkritingz | Comments Off | Filed in Tips n Trik, Wordpress

limit search resurltWordPress, by default, limits your search results to 10 per page. When doing a normal query, you’d use get_posts(numberposts=99) to determine how many results appear from your query. You use a different parameter, showposts, for search pages.

So how do you modify the query to show what you want? Simply take the current $query_string (generated by WordPress’s header functions) and modify its showposts. Make sure to do this before the loop and you’re all good! All the code you need is below.

(more…)

Tags: , , ,