Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Add JiaThis to the home page too
- Version: 0.1
- From http://wordpress.org/support/topic/add-content-under-post-on-main-page?replies=8
- */
- add_filter( 'the_content', 'mh_jiathis' , 20 );
- function mh_jiathis($content) {
- $jiathis_code = get_option('jiathis_code');
- $jiathis_dir = 'float:'.get_option('jiathis_dir');
- $jiathis_clear = '<div style="clear:both; margin-top:5px; margin-bottom:5px;"></div>';
- // if(is_single() || is_page() && get_option('jiathis_feed') == 'yes') {
- if( is_home() && get_option('jiathis_feed') == 'yes') {
- if(get_option('jiathis_pos') == 'down') {
- $content = $content.$jiathis_clear."<div style=\"".$jiathis_dir."\">".$jiathis_code.'</div>'.$jiathis_clear;
- } else if(get_option('jiathis_pos') == 'up') {
- $content = $jiathis_clear."<div style=\"".$jiathis_dir."\">".$jiathis_code.'</div>'.$jiathis_clear.$content;
- }
- }
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement