bbPress

Simple, Fast, Elegant

bbPress support forums » Installation

Change Gravatar Size?

(5 posts)
  • Started 7 months ago by citizenkeith
  • Latest reply from citizenkeith
  • This topic is resolved

Tags:

  1. citizenkeith
    Member

    I've installed 0.9.0.1 at my test site. Gravatars show in the user profile at their true size of 80x80. However, in the kakumei theme, they are displayed at 48x48. I can't find where this can be changed. I looked in the CSS and in the post.php file.

    Am I blind?

    Posted 7 months ago #
  2. Wyvn
    Member

    Here is what a quick grep came up with:

    bb-includes/template-functions.php:function post_author_avatar( $size = '48', $default = '', $post_id = 0 ) {

    Posted 7 months ago #
  3. citizenkeith
    Member

    Thanks Wyvn. It would be nice if there was something in the Admin menu to change this, but for now I'll just change that file. :)

    Posted 7 months ago #
  4. Well, if you like to hack you admin files, you can add the following code to the options-general.php file just after line 143, making this code start on line 144;

    <label for="avatars_size">
    			<?php _e('Gravatar Size:'); ?>
    		</label>
    		<div>
    			<select name="avatars_size" id="avatars_size">
    <?php
    $selected = array();
    $selected[bb_get_option('avatars_size')] = ' selected="selected"';
    ?>
    				<option value="16"<?php echo $selected[16]; ?>><?php _e('16 px'); ?></option>
    				<option value="32"<?php echo $selected['32']; ?>><?php _e('32 px'); ?></option>
    				<option value="36"<?php echo $selected['36']; ?>><?php _e('36 px'); ?></option>
    				<option value="48"<?php echo $selected['48']; ?>><?php _e('48 px'); ?></option>
    				<option value="80"<?php echo $selected['80']; ?>><?php _e('80 px'); ?></option>
    <?php
    unset($selected);
    ?>
    			</select>
    			</div>

    And in the bb-includes/template-functions.php file, after line 1198 you can add this;

    $size = bb_get_option('avatars_size');

    Then you can change the size in the admin section, and the correct size will show with the posts.

    Or you can download the edited files here

    --
    Rune

    Posted 7 months ago #
  5. citizenkeith
    Member

    Thanks Rune. I actually don't like to hack admin files... Wyvn's suggestion did the trick. I just made note of the change so I can do it again when I upgrade next.

    Maybe you can submit that for a future version of bbPress. :-)

    Posted 7 months ago #

RSS feed for this topic

Reply

You must log in to post.

Code is Poetry.