• When I‘m using my whole blog within ActivityPub is there a way to give it an Avatar and a header image in Mastodon?

    Currently I have no header and the WordPress Logo as Avatar.

    see: [email protected]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Matthias Pfefferle

    (@pfefferle)

    If you set a site-icon/logo in your theme, it will also be used for ActivityPub and to have a header image, you have to use a header image (this is not supported by all themes, but we are working on a feature to upload one, independent of the theme you use).

    Thread Starter iMarc

    (@imarc)

    I think my theme is too old, I have not a site-icon nor a header image. But I have a lot of icons defined in the header section of my site code:

    <link rel="apple-touch-icon" sizes="180x180" href="/favicons/apple-touch-icon.png"> <link rel="icon" type="image/png" href="/favicons/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/favicons/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/favicons/manifest.json"> <link rel="mask-icon" href="/favicons/safari-pinned-tab.svg" color="#5bbad5"> <link rel="shortcut icon" href="/favicons/favicon.ico">

    It would be fantastic if you add the option to upload a header image.

    Thread Starter iMarc

    (@imarc)

    Hi Matthias,
    I now have included two functions into my client theme functions.php to add a site-icon and a header image and I was able to upload them with the Customizer. But because my theme doesn’t use them, I have nothing added in the template files.

    But nothing changed. Still the search on Mastodon shows my profile without a header and with the WordPress logo.

    I hope that your code fetches them from the database.
    What could I do to update the external view of the profile?

    • This reply was modified 1 year, 5 months ago by iMarc.
    • This reply was modified 1 year, 5 months ago by iMarc.
    Thread Starter iMarc

    (@imarc)

    It starts to work now. The header image was fetch, the side-icon also, bit doesn’t look nice in the dark theme. I have changed it now to an image of myself, but this isn’t fetched again.

    Plugin Author Matthias Pfefferle

    (@pfefferle)

    I now have included two functions into my client theme functions.php to add a site-icon and a header image and I was able to upload them with the Customizer. But because my theme doesn’t use them, I have nothing added in the template files.

    Nice!

    It starts to work now. The header image was fetch, the side-icon also, bit doesn’t look nice in the dark theme. I have changed it now to an image of myself, but this isn’t fetched again.

    Mastodon caches these Information and I have no idea for how long… It should be updated with one of your next posts…

    Bard says that there is a hook for setting the header image and suggests this code:

    // Add ActivityPub header image metadata
      add_action( 'activitypub_head', function() {
        $image_url = get_theme_mod( 'site_header_image' );
        if ( $image_url ) {
          echo '<link rel="image_src" href="' . esc_url( $image_url ) . '">';
        }
      } );

    Will this work or is Bard hallucinating?

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Blog wide publishing – Avatar and header image?’ is closed to new replies.