[Resolved] Schema markup in copyright section

Home Forums Support [Resolved] Schema markup in copyright section

Home Forums Support Schema markup in copyright section

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #966715
    maria

    I’m trying to add schema markup to the custom footer/copyright section, but it’s getting stripped out. Is that how it’s supposed to work or is this a bug? This is the code that I’ve put there:

    <div itemscope itemtype="http://schema.org/Dentist">%copy% <span itemprop="name">NAME OF COMPANY HERE</span> %current_year% </div>

    #967134
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It might not like the HTML attributes, I’ll look into that.

    For now, try using a filter instead:

    add_filter( 'generate_copyright', function() {
        ?>
            <div itemscope itemtype="http://schema.org/Dentist">&copy; <span itemprop="name">NAME OF COMPANY HERE</span> <?php the_date( 'Y' ); ?> </div>
        <?php
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know if that works or not ๐Ÿ™‚

    #968733
    maria

    That worked, thanks. The schema markup code is now there. However, the year was showing as 2014, so I hard-coded it to 2019. I’m guessing that this has to do with the system date in the staging environment.

    #968932
    Tom
    Lead Developer
    Lead Developer

    Yes, that’s likely it ๐Ÿ™‚

    Glad I could help!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.