• Resolved IdeFixx

    (@idefixx)


    Hello.

    I ran into an issue with the shortcode inserted in Twenty Twenty-Three theme. This shortcode block works fine in the theme part:

    [post_coauthors]

    Here is its code from the child’s theme functions.php:

    add_shortcode( 'post_coauthors', 'myshortcode_coauthor' );
    function myshortcode_coauthor() {
    return coauthors_links();
    }

    But it also breaks the structure of an HTML document:

    <html>
    <head></head> - empty
    <body>
    <a>author's name and link</a> - first time here
    <meta> - all header tags are here
    <main>
    <div class="wp-block-group">
    <a>author's name and link</a> - secondly here

    As you can see:

    1. HTML head content is shifted to <body>
    2. Content of the shortcode is displayed twice

    Even if I try to disable all other plugins it does not help. The HTML structure is still broken. Co-Authors Plus Troubleshooting Mode does not help either, it just activates parent theme without the shortcode.

    I’ll be glad for any suggestions or ideas on how can I fix it. Thank you.

    WP Version 6.3.1
    Co-Authors Plus Version 3.5.15
    Twenty Twenty-Three Version: 1.2

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Shortcode breaks HTML’ is closed to new replies.