Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18574

    I want to take the “About The Author” part from pages to sidebars on main page. So I want delet it on pages and just place to sidebars on main page. How can I do that?

    #99986

    Afaik this is not easily possible because the sidebar/widget code is outside the post/page content loop and query. Depending on your php skills you can try to implement this feature though. I’d store the entry id into a global variable which can be used in sidebar.php to get the author information. But you’d also need to find a way to handle pages with many entries (like archives, etc.) – eg conditional tags: http://codex.wordpress.org/Conditional_Tags can be used for this task. I hope this helps you or your developers a bit.

    #99987

    Can’t we delete the “About The Author” part landing at the end of the pages? Is it so difficult? I want to delete it from there and add to the right sidebar as an widget or as an info with my picture. Thats all. I think it mustn’t be so difficult?

    #99988

    Removing the author box is no problem at all – open up single.php and delete following code:

    <div class='entry' id="author-box">
    <div class="gravatar">
    <?php
    $author_email = get_the_author_email();
    echo get_avatar( $author_email, $size = '60');
    the_author_posts_link();
    ?>
    </div>
    <div class="author-info">
    <h3><?php _e('About the author','newscast'); ?></h3>
    <?php
    $description = get_the_author_description();
    if($description != '')
    {
    echo $description;
    }
    else
    {
    _e('The author didnt add any Information to his profile yet','newscast');
    }

    ?>
    </div>
    </div>

    #99989

    Thanks for that. So if we add these codes to the sidebar.php, can’t we see it on sidebar? Isn’t there an easy way to add author info & picture to sidebar?

    #99990

    No the code won’t work in the sidebar (or tbh it works in some special cases but it would be very buggy and thus useless) because (as I explained above) it requires the post loop and the data is not available in sidebar.php. You can search for a widget here: http://wordpress.org/extend/plugins/search.php?q=author+widget but I’m not sure if they’ll work.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘How to take (transfer) the "About the Author" part to main page (sidebar)’ is closed to new replies.