Welcome to PressWork!

Want to ask a question or join the discussion? Great! Join now.

In this Discussion

author avatar?
  • how to add author avatar on blog next to title with presswork theme?

    http://www.lizartlizard.com/blog/
  • This is the code you need: http://codex.wordpress.org/Function_Reference/get_avatar

    You need to rewrite the pw_post_header() function using a Custom Action:
    function custom_pw_post_header() {
    echo pw_function_handle(__FUNCTION__);
    ?>
    <header>
    <hgroup>
    <h1 class="posttitle">
    <?php if(!is_singular()) { ?><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', "presswork" ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php } ?>
    <?php the_title(); ?>
    <?php if(!is_singular()) { ?></a><?php } ?>
    </h1>
    <?php if(!is_page()) { ?>
    <h2 class="meta">
    <?php
    $user_ID = get_the_author_meta('ID');
    echo get_avatar( $user_ID, 48 );
    _e("by", "presswork"); echo " "; the_author_posts_link();
    echo '&nbsp;&bull;&nbsp;';
    the_time(get_option('date_format'));
    if(!is_home()) {
    echo '&nbsp;&bull;&nbsp;';
    the_category(', ');
    }
    if(comments_open()) { echo '&nbsp;&bull;&nbsp;'; comments_popup_link(__('0 Comments', "presswork"),__('1 Comment', "presswork"),__('% Comments', "presswork")); }
    ?>
    </h2>
    <?php } ?>
    </hgroup>
    </header>
    <?php
    }
    remove_action('pw_archive_post_middle', 'pw_post_header', 10);
    remove_action('pw_author_post_middle', 'pw_post_header', 10);
    remove_action('pw_category_post_middle', 'pw_post_header', 10);
    remove_action('pw_search_post_middle', 'pw_post_header', 10);
    remove_action('pw_index_post_middle', 'pw_post_header', 10);
    remove_action('pw_single_post_middle', 'pw_post_header', 10);
    remove_action('pw_page_post_middle', 'pw_post_header', 10);
     
    add_action('pw_archive_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_author_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_category_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_search_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_index_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_single_post_middle', 'custom_pw_post_header', 10);
    add_action('pw_page_post_middle', 'custom_pw_post_header', 10);


    Once that is done you would have to style it the way you want.
    image Senior Developer & Co-Founder of PressWork