Inline-Table under TwentyTwelve not working
It’s because the TwentyTwelve theme has “clear: both;” set on H3 tags, which messes up the layout. Try adding this CSS: #authorlist h3 { clear: none !important; }
It’s because the TwentyTwelve theme has “clear: both;” set on H3 tags, which messes up the layout. Try adding this CSS: #authorlist h3 { clear: none !important; }
From your comments, it seems you want to replace the post preview on facebook. This could be hard, because you try to modify the behavior of another webpage. With the opengraph protocol it can be done. add_action( ‘wp_head’, ‘get_facebook_meta_tags’, 10, 0 ); function get_facebook_meta_tags() { global $post; // bail if the post is not in … Read more
There was a lotta junk in that function, here’s all you need: function get_post_image() { global $post; if ( preg_match( ‘/<img.+?src=[\'”]([^\'”]+)[\'”].*>/i’, $post->post_content, $matches ) ) $image = $matches[1]; else $image = get_avatar( $post->post_author ); return $image; }
The get_avatar function is pluggable, meaning that you can define a function of your own having that name and completely overwrite the default function. If you look at the source for the “Simple Local Avatars” plugin, that is exactly what it has done. get_avatar in your code should be using the function defined by “Simple … Read more
Try this: $author_id = get_the_author_meta(‘ID’); echo bp_core_fetch_avatar ( array( ‘item_id’ => $author_id, ‘type’ => ‘full’ ) ); Defaults: array( ‘item_id’ => false, ‘object’ => ‘user’, ‘type’ => ‘thumb’, ‘avatar_dir’ => false, ‘width’ => false, ‘height’ => false, ‘class’ => ‘avatar’, ‘css_id’ => false, ‘alt’ => ”, ’email’ => false, ‘no_grav’ => false, ‘html’ => true, … Read more
This function bp_get_user_has_avatar() calls bp_core_fetch_avatar with this argument ‘no_grav’ => true so you could write your own function to see if a user is not using the default avatar: function lurie_avatar_check( $user_id ) { $retval = false; if ( bp_core_fetch_avatar( array( ‘item_id’ => $user_id, ‘no_grav’ => false, ‘html’ => false ) ) != bp_core_avatar_default( ‘local’ … Read more
Here we go, found a nice thread which gave some answers and developed this which works a treat: if ( class_exists( ‘coauthors_plus’ ) ) { $co_authors = get_coauthors(); foreach ( $co_authors as $key => $co_author ) { $co_author_classes = array( ‘co-author-wrap’, ‘co-author-number-‘ . ( $key + 1 ), ); echo ‘<div class=”‘ . implode( ‘ … Read more
You’re looking for the get_avatar function, documented here get_avatar( $id_or_email, $size, $default, $alt ) You’ll need either a user ID, or an email to use it, something like this should do the trick: echo get_avatar( get_comment_author_email(), ‘thumbnail’ ); If avatars are turned off in settings, this function will not return anything
If I understand correctly, you want 2(two) different shapes, and actualy not 2 different images?! If so, this answer below is a solution which you can use. But when I am wrong, my answer is probably useless. I personally would do such with CSS. I am not saying that it always works/is the solution, but … Read more
Here is the code how i call the avatar on my posts: <?php echo get_avatar( $post->post_author, $size=”150″); ?> You can also define a default avatar if user has no avatar.