-1
<?php echo do_shortcode("[sharethis]"); ?> 
            <?php wp_related_posts()?> 

There are 2 short codes above 1) share this plugin short code 2) related posts short code

now my QUESTION

first see this LINK

At the ending of the post you can see the author box

i want want this author box below the above mentioned plugins

i tried these shortcode by keeping in single.php page but they didnt worked.

Please help me, to insert both the shortcodes exactly below the content and above author box.

1

It looks like you are using the Fanciest Author Box plugin ( FAB ).

This plugin is not open source so it's therefore difficult to give a detailed solution, since I can't look at the code inside it.

I assume it uses the the_content filter with some priority p.

To move the FAB box below the Sharethis & Related-Posts, you can then try this:

/**
 * Append sharethis & related-posts to the content
 * See http://wordpress.stackexchange.com/q/116264/
 *
 * @param string $content
 * @return string $content
 */
function the_content_wpse_116264( $content ){

    if( is_single() ){
        $content .= do_shortcode( '[sharethis]' ); 

        if( function_exists( 'wp_get_related_posts' ) )
            $content .= wp_get_related_posts();

    }

    return $content;
}

add_filter( 'the_content', 'the_content_wpse_116264', 11, 1 );

where the priority 11 is hopefully lower than p.

If this still gives you problem regarding the priority, you could try to remove the the_content filter applied by FAB and add it again with the relevant priority.

| improve this answer | |
  • Sir, when paste the given code in function.php file in dreamweaver editor it showed me error in related posts if condition,<br /> so i removed related posts code and just used Sharethis short code.<br /> so sir, please correct the related posts if condition check the used code in my page sir [link] orclage.com/… – sandeep arron Oct 1 '13 at 2:39
  • aha, a missing parenthese ), sorry about that, it should be fixed now. – birgire Oct 1 '13 at 8:51
  • And it worked sir thank you very much, and sir can i get ur fb id (if u dont mind) :P – sandeep arron Oct 1 '13 at 13:08
  • great to hear it worked and good luck with your project (ps: I'm not a user of FB) – birgire Oct 1 '13 at 20:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.