This should work great… in this example i am using wordpress codex so you can comapre:
From WordPress Codex
<?php echo get_avatar( $id_or_email, $size, $default, $alt ); ?>
so… Based on that…
This is the code you should embed in the desired location in your theme:
<?php
wp_get_current_user();
$size = array(60,60); // this is the size of the avatar
echo get_avatar( $current_user->user_email, $size, $default, $current_user->display_name );
?>
.
Hope this helps 🙂
Related Posts:
- Pass variables from one widget to another widget
- How/where is the global variable $wp_registered_widgets filled?
- Code for Recent Posts Widget
- Modifying the default search widget
- Is there a way to add more tags to the tag cloud?
- Modify recent post sidebar to show post thumbs with out plugins
- How to build widget with arrays inside arrays?
- How do I save data from submitted form from widget
- Why Can’t wp_editor Be Used in a Custom Widget?
- How to listen to color changes on the color picker?
- Add New Footer Widget Area with Limited Options?
- Add div class to only one widget
- How to use control_callback when creating a widget via functions.php or plugin?
- Call sidebar from a template
- Widget Area: Modify $param[‘xy’] from widget-$n
- Widget area inside a widget
- Defer Code in Widgets – Page Speed
- Where are widget configurations stored?
- How to limit wp_get_archives to show months for the X years only
- Bolding specific word(s)/parts of widget title
- How to add a class to a link in text editor
- WordPress widget new instance creates content duplicates
- Remove the widgets tab from theme customizer
- Remove/Add widgets from/to the Available Widgets pool
- Remove/Unregister or hide a widget added by a plugin
- How can I apply css styling to the current day in the calendar widget
- How to check if a widget has no title
- Is there an official email form widget or block?
- Widget html code error
- Post-specific widgets in WordPress ‘Twenty Fourteen’ theme
- Excluding specific widgets from default sidebar class
- How to truncate titles in Recent Posts widget?
- Can WordPress Read Its Own RSS Feed?
- Can’t see widget areas in my customizer
- Display custom widget, added as a shortcode in the correct place
- Show posts from one category with thumbnail and description on latest
- Widget textarea input gets formatted
- Show widget differently depending on if it’s in the sidebar or footer
- Enqueue script/style if certain widget has certain value
- How to display/register widget only on post pages in custom plugin
- Is it possible to display tag cloud widget by category?
- Widgets not saving values
- Fire on widgets_init only on dashboard
- Access Customizer widget instance form
- Allow shortcode for custom widget
- One register_sidebar function works, the other doesn’t?
- WordPress widget title coding
- Text Widget in Footer for just 1 page template
- Modify WordPress widgets Screen
- What does apply_filters() do exactly? [duplicate]
- How to change color of registered widget areas in admin?
- Filter Text from sidebar widget?
- How to filter widget(s) based on a specific category landing page
- Search transients through widget
- what is the difference between these two types of widget form method
- Change the background color of my theme widgets
- Output column number according to active sidebars
- Instance not inserting data for widget
- Why would apply_filters return a non-empty string, when the value returned is empty?
- How to customize wordpress sidebar widget
- Jquery checkbox -show posts with checked tags
- Got a problem with a widget
- Widget control – putting a slideshow in the widget area
- WordPress Local to Live and The Missing Widgets!
- Extending the WordPress Recent Posts Widget
- delete widget upon uninstall
- Unable to see Widget Submenu under Appearance with Class Based WP_Widget
- How to update a widget data?
- Recently changed domain name. Home page widgets are now not in the customize menu yet still being on the page
- Is it possible to dynamically output the name of the widgets?
- I accidentally added a widget area called sidebar 1
- wp_registered_widgets doesn’t contains my widgets
- How can I write this code snippet so that it echo’s the response when submitting empty fields?
- What is the difference between widget object and widget instance?
- How Can I Replicate & Register a Widget from the Child Theme
- How to retrieve category ID’s from widget settings?
- My plugin works in home page, but doesn’t work in post page
- Widget text color change
- How to make featured area?
- Checking if widget has title not working
- How to create another widgets.php page
- widget that will do shortcodes that user inputs
- Disable wordpress widget automatically on error
- Can I add a widget to the of my site?
- Widget dynamically add new input field
- Widget Development – Displaying dropdown content
- WordPress function breaks widget’s markup?
- Registering multiple copies of a widget
- How do I stop out of stock items from appearing on my WooCommerce site when using the Layered Nav widget [closed]
- Single Widget Multi Sidebar
- An issue with register_sidebar and the admin interface
- menu in different page in different style
- Add text to Text Widget using Javascript
- Widget on home page displays wrong time compared to same widget on inside pages
- Widget logic not working
- Subpages menu on sidebar plus widgets
- Widgets in PHP files?
- Text Widget Not Working
- Sample widget code which get data(1-5 record) from Wp_Admin panel and display to Homepage(WordPress Custom Theme)
- getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor