• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Change schema from Creative work to Article

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Change schema from Creative work to Article

This topic is: resolved

Tagged: schema

  • This topic has 3 replies, 3 voices, and was last updated 5 years ago by netproject.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 1, 2017 at 11:10 am #213148
    AngeloDavis
    Participant

    Is there a way to change a template page to return "article" instead of "creative work"

    https://www.angelodavisrealtor.com/real-estate/415-FARMER-BROTHERS-DRIVE-SEDONA-AZ-86336/514658/258/
    November 1, 2017 at 12:04 pm #213150
    Victor Font
    Moderator

    Add this to functions.php:

    
    add_filter( 'genesis_attr_entry', 'entry_attributes_article' );
    function entry_attributes_article( $attributes ){
        
        $attributes['itemtype']  = 'http://schema.org/Article';
        
        return $attributes;
    }

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    November 1, 2017 at 12:39 pm #213151
    AngeloDavis
    Participant

    Worked like a charm. Thanks Victor!

    January 19, 2018 at 5:06 am #215528
    netproject
    Participant

    According to Google's Structured Data Testing Tool changing the Itemtype to Article, TechArticle or Blogposting will require further attributes/itemprops in order to receive a results free from errors or warnings. I was able to add the Itemprop Headline and change Itemprop Text into ArticleBody.

    But, what would be the filter & function to add further Itemprops using your code above, please? An example code would help me a lot here 🙂

    • datePublished
    • image
    • publisher
    • dateModified
    • dateModified
    • mainEntityOfPage
    • mainEntityOfPage

    I already tried genesis-attr_entry-modified-time or genesis-attr_entry-published-time without getting results.

    Thanks a lot for a hint
    Best Mark

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change schema from Creative work to Article’ is closed to new replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble