ThemeShaper Forums » Thematic

[closed]

Thematic Comments

(6 posts)
  • Started 2 years ago by meevil
  • Latest reply from meevil
  • This topic is resolved
  1. Hey guys, me again!

    Loving how powerful Thematic is, but I've hit a bit of a snag in development.

    1) How do I change the avatar size in the comments section?

    2) How do I make comment replies "Stack" underneath the original comment, instead of appearing within the original comment DIV?

    Thanks guys, you've been a great help so far!

    Posted 2 years ago #
  2. line 181 of comments-extensions.php

    $avatar_size = apply_filters( 'avatar_size', '80' ); // Available filter: avatar_size

    the apply_filters is our signal that we can change something w/ a filter. the process is the same every time you want to change something.

    1. troll through the extensions folder to find the thing you need to change (conveniently the functions are split into sensibly named files.. like comment-extensions.php for all the functions having to do w/ comments)

    2. determine if a filter is available or if you need to use an override. this might be a little tougher, but often both will work. in your case there isn't an override option, so you can only go w/ filter. people will often use an override b/c it is simpler to get your head around, though a filter solution will often be more elegant for small changes.

    3. create the new function in your functions.php in your case you need to target the avatar_size filter.

    filtering something always takes the same basic setup.

    function gonna_filter_something($variable){ //if we need the original variable then pass it in as a function argument
       $variable .= 'bacon'; //just tacked bacon on to the end of $variable
       //$variable = 'bacon'; //if uncommented, sets the variable equal to bacon
       return $variable; //send the new version of $variable back to the apply_filters function
    }
    add_filter('target_filter','gonna_filter_something', priority#);

    where priority# is the order at which this filter will be processed if there are multiple functions being added to the same filter. it defaults to 10 i think and you don't need it unless you know there are multiple actions being run. $variable name can be anything. i usually let it match the name in the original function to help me remember what it is, but it doesn't have to b/c of what is called "variable scope". it could be $apple or $bacon, b/c it only exists inside your gonna_filter_something function.

    SO, in your case:

    function kia_change_avatar_size(){ //we don't need the original value
       return 200; //send back a really large size
    }
    add_filter('avatar_size','kia_change_avatar_size');

    2.) disable threaded comments in your Settings>Discussion

    Posted 2 years ago #
  3. Helga, you're a star, thanks so much for explaining filters! Really helped, and I learned something too! :D

    I copied and pasted the code straight into my functions file, but it hasn't seemed to pass it through to the original variable.

    Do I need to call this function somewhere?

    Posted 2 years ago #
  4. EDIT: Woops! Sorry for the double post, the last post didn't show up on my screen, and I can't find a way to delete this one D:

    Posted 2 years ago #
  5. oh apparently also there is CSS that you need to change

    #comments-list li .avatar {
    position: absolute;
    top: 22px;
    left: 1.5em;
    width: 36px;  //change to match
    height: 36px;  //change to match
    }
    Posted 2 years ago #
  6. That's done the trick! Thanks a bunch :D

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.