wordpress-activitypub icon indicating copy to clipboard operation
wordpress-activitypub copied to clipboard

Banner Image?

Open ambanmba opened this issue 1 year ago • 4 comments

The avatar image translates nicely to Mastodon, but is there a way to also do a banner image?

ambanmba avatar Aug 14 '23 02:08 ambanmba

How did you get an avatar image for the main site blog?

moodler avatar Oct 13 '23 14:10 moodler

the avatar image and banner image for a main site blog are retrived from the theme options. learned the hard way because I use a self-made theme and never bothered to add theme options. :-) If you have a theme with those options, look for Design -> Customizer -> Header Image for the banner image. The avatar is the "website icon" in the customizer. If you go with a selfmade theme, you need to add the options via the theme's functions.php, for the header image:

$custom_header_defaults = array(
		'default-image'          => '/[foo]/wp-content/uploads/2023/10/IMG_8558.jpg',
		'random-default'         => false,
		'width'                  => 0,
		'height'                 => 0,
		'flex-height'            => false,
		'flex-width'             => false,
		'default-text-color'     => '',
		'header-text'            => true,
		'uploads'                => true,
		'wp-head-callback'       => '',
		'admin-head-callback'    => '',
		'admin-preview-callback' => '',
		'video'                  => false,
		'video-active-callback'  => 'is_front_page',
	);
	add_theme_support( 'custom-header', $custom_header_defaults );

iamwebrocker avatar Dec 27 '23 23:12 iamwebrocker

Many thanks for the detailed info. I'm using GeneratePress, and I thought I'd set all those, but I'll fiddle with something hardcoded like this. (I see something converted things to SVG along the way too which might have been it)

moodler avatar Dec 28 '23 04:12 moodler

Hi,

what makes this tricky to debug: depending on the instance there may be a stubborn cache involved, and even if your site is now using the site icon and custom header options, the images won't show for quite a while in the fediverse. (been there).

I don't know if/how you would alter the function.php of a highly customisable theme like GeneratePress, but in theory it should use the options mentioned under the hood already. You can see here https://github.com/Automattic/wordpress-activitypub/blob/7855437c5c287eb87ecdd685aeff6affc6032f2a/includes/model/class-blog-user.php#L149 which options are used for the avatar (and a few lines further down the one for the banner image)

iamwebrocker avatar Dec 28 '23 10:12 iamwebrocker

This issue is stale because it has been open 120 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar Apr 27 '24 01:04 github-actions[bot]