• 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

Snippets – product archives (woocommerce) & json schema.org local business

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 › Snippets – product archives (woocommerce) & json schema.org local business

This topic is: not resolved

Tagged: local business schema, Meta Description, product archive, seo

  • This topic has 2 replies, 3 voices, and was last updated 8 years, 10 months ago by nobs.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • April 20, 2017 at 3:06 am #205047
    frenchie
    Member

    I am kind of proud about my last 2 sites - highly optimized for SEO without using a huge and lumbering SEO plugin. I hope these code snippets help someone else.

    https://www.ecole-ski-evasion.com and its French version. All interconnected using hreflang attributes and the SEO is all built in without using an inefficient SEO plugin.

    The bits to remember if you don't want to use Yoast for example is this type of thing in your functions.php file.

    1. The product archive for a woocommerce shop needs a meta description. This seems to work nicely for me:

    add_action('genesis_meta', 'custom_seo_description');
    function custom_seo_description() {
    if ( is_shop() ) {
    echo '<meta name="description" content="For children and adults, our school offers a range skiing lessons in the French Alps at Serre Chevaliers." />';
    }
    }

    2. A title for product archive for a woocommerce shop - here we go

    add_filter( 'wp_title', 'my_title_function', 10, 3 );
    function my_title_function( $title) {
    if ( is_shop() )
    return 'Ski & snowboard lessons';
    else
    return $title;
    }

    And finally but not least. Your local business json being loaded onto the home page only. Just my example.

    /* Json payload for local SEO */

    add_action( 'wp_head', 'child_payload', 5 );

    function child_payload() {
    if ( is_front_page() ) { ?>
    <script type="application/ld+json"> {
    "@context" : "http://schema.org",
    "@type" : "localBusiness",
    "address" : {
    "@type": "PostalAddress",
    "addressLocality": "Saint-Chaffrey",
    "addressCountry": "France",
    "postalCode": "05330",
    "streetAddress": "Centre commercial Le Serre d'Aigle, Place du Téléphérique" },
    "name":"ESI Ecole de Ski Evasion",
    "email":"[email protected]",
    "hasMap":"https://www.google.com/maps/place/ESI+Ecole+de+ski+Evasion/@44.9333613,6.5869877,15z/data=!4m5!3m4!1s0x0:0xcedd352ab6a10f11!8m2!3d44.9333613!4d6.5869877",
    "telephone":"+33 4 92 24 02 41",
    "openingHours": [
    "Mo,Tu,We,Th,Fr,Sa,Su, 08:45-12:00, 14:00-18:00" ],
    "Image": "https://www.ecole-ski-evasion.com/wp-content/uploads/2017/04/ski-school.jpg",
    "logo" : "https://www.ecole-ski-evasion.com/wp-content/uploads/2017/04/ecole-ski-logo.png",
    "url":"https://www.ecole-ski-evasion.com",
    "sameAs" : [ "https://www.ecole-ski-evasion.fr", "https://www.facebook.com/EcoleDeSkiEvasion", "https://plus.google.com/113181281635819810244/, https://www.youtube.com/channel/UCSFIqTft-rpUu9r5RkUzx_g"]
    }
    </script>
    <?php }}

    Using this code and your normal Genesis SEO settings, a large SEO plugin becomes pointless for me at least.

    April 25, 2017 at 7:51 am #205266
    Victor Font
    Moderator

    SEO is a lot more complex than just using the code you suggest. Thanks for posting and glad it works for your needs.


    Regards,

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

    May 4, 2017 at 2:52 am #205862
    nobs
    Member

    Thanks so much Frenchie - that is very helpful & exactly what I needed! Much appreciated.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 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