Site logo

Archived topic

Shortcodes not working on author archive

10 replies · Started by Adrian on May 27, 2021

Viewing posts 1–11 of 11

Any idea why shortcodes don't display in the author archive?

It'd to display the shortcode as is.

The same shortcode displays fine in the author bio created using a dynamic GP block.

Example in private info.

Thank you.

Hi there,

how are you adding the Shortcode is it in the user biography field - as i believe that only outputs plain text by default.

Instead you could use the Block Element to insert that shortcode ( or create the entire entry header ) for your author archive.

Bumping it in case it was missed as you are often super fast.

Thanks.

Shortcodes will get stripped as will other HTML if you add it to the a USER meta field such as the Biography.
But they should work if you add them using a Block / Hook element to the archive - have you tried that method ?

I added code in functions.php so it doesn't strip HTML. It works fine on the posts see the author bio in private information.

add_filter( 'get_the_author_description', 'tu_author_desc_autop' );function tu_author_desc_autop( $output ) {    return wpautop( $output );}

It's only stripped on the archive page.

Unless I am missing something the Block/Hook method won't work as it's not part of the page template but custom for each author and I have hundreds.

What exactly is the shortcode doing ?

Displaying this: https://gyazo.com/eb0aa8a7a9b9f0d3aab59ae31b2b5f4e

It's the author's books and no way to replicate that without leveraging a 3rd party plugin via shortcode.

Also, the entire author box line spacing and HTML formatting and links are kept in the archive page, just not the shortcode part.

Thanks.

David, your support is amazing :)

It worked - it displays everything correctly now, including the shortcode.

Thank you.

Glad we could be of help!

This archived topic is closed to new replies.