wordpress-activitypub
wordpress-activitypub copied to clipboard
Banner Image?
The avatar image translates nicely to Mastodon, but is there a way to also do a banner image?
How did you get an avatar image for the main site blog?
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 );
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)
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)
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.