Advertisement
vapvarun

BuddyPress Custom Avatar Dimensions

Dec 12th, 2023
677
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.41 KB | Software | 0 0
  1. /**
  2.  * BuddyPress Custom Avatar Dimensions
  3.  *
  4.  * This configuration enhances the quality of BuddyPress member avatars by defining
  5.  * custom dimensions. Place these definitions in your theme's functions.php file.
  6.  * Adjust the width and height values to suit your site's design and quality requirements.
  7.  */
  8.  
  9. // Define custom thumbnail width for BuddyPress avatars if not already set
  10. if ( ! defined( 'BP_AVATAR_THUMB_WIDTH' ) ) {
  11.     define( 'BP_AVATAR_THUMB_WIDTH', 100 ); // Change this to your desired thumb width
  12. }
  13.  
  14. // Define custom thumbnail height for BuddyPress avatars if not already set
  15. if ( ! defined( 'BP_AVATAR_THUMB_HEIGHT' ) ) {
  16.     define( 'BP_AVATAR_THUMB_HEIGHT', 100 ); // Change this to your desired thumb height
  17. }
  18.  
  19. // Define custom full-size width for BuddyPress avatars if not already set
  20. if ( ! defined( 'BP_AVATAR_FULL_WIDTH' ) ) {
  21.     define( 'BP_AVATAR_FULL_WIDTH', 300 ); // Change this to your desired full avatar width
  22. }
  23.  
  24. // Define custom full-size height for BuddyPress avatars if not already set
  25. if ( ! defined( 'BP_AVATAR_FULL_HEIGHT' ) ) {
  26.     define( 'BP_AVATAR_FULL_HEIGHT', 300 ); // Change this to your desired full avatar height
  27. }
  28.  
  29. /**
  30.  * Usage Guide:
  31.  * 1. Insert this code in your theme's functions.php file.
  32.  * 2. Modify the dimensions (width and height) to match your desired avatar size.
  33.  * 3. Ensure your theme's CSS accommodates these new sizes appropriately.
  34.  */
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement