• Resolved artandscores

    (@artandscores)


    Hi there, thanks for this wonderfull plugin.

    A litle thing, i think very easy to solve.
    Search.google.com/structured-data/testing-tool says: @type Product –> name required

    It′s just to add into template-function.php:

    echo ‘<span itemscope itemtype=”https://schema.org/Product”&gt;
    <span itemprop=”name”>’ . $title . ‘</span>‘;

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Pippin Williamson

    (@mordauk)

    Hi there!

    We do add that actually. Perhaps something else on the site is removing it.

    Could you please tell me the URL to one or more of your product pages so I can take a look?

    Thread Starter artandscores

    (@artandscores)

    Yes of course: https://goo.gl/8kGaQE

    Ummmm could be, i think could be related to other issue: hatom, missing author/update. Next code is working fine in all site. But just when i implemented downloads, its not working on domain/downloads/productXY

    if ( ! function_exists( ‘generate_post_meta’ ) ) :
    add_action( ‘generate_after_entry_title’, ‘generate_post_meta’ );
    function generate_post_meta()
    {
    if ( ‘post’ == get_post_type() || ‘attachment’ == get_post_type() ) : ?>
    <div class=”entry-meta”>
    <?php generate_posted_on(); ?>
    </div><!– .entry-meta –>
    <?php endif;
    }
    endif;

    Plugin Contributor Pippin Williamson

    (@mordauk)

    if ( ‘post’ == get_post_type() || ‘attachment’ == get_post_type() ) :
    should be changed to
    if ( 'post' == get_post_type() || 'attachment' == get_post_type() || 'download' == get_post_type() ) :

    Thread Starter artandscores

    (@artandscores)

    – Yes the second solved ???? (now there are updated + published fields)

    – about first, missing “name” into schema Product, i see the name goes to schema CreativeWork (who is near following Product). ?How it can do “name” for both?:

    <main id=”main” class=”site-main”> <span itemscope itemtype=”https://schema.org/Product“><article id=”post-3790″ class=”post-3790 type-download status-publish hentry edd-download” itemtype=’https://schema.org/CreativeWork‘ itemscope=’itemscope’><div class=”inside-article”><header class=”entry-header”><h1 class=”entry-title” itemprop=”headline”><span itemprop=”name”>Agnus Dei Missa Brebis – Haan | Midi Free Download TUTTI</span></h1>

    • This reply was modified 7 years, 9 months ago by artandscores.
    • This reply was modified 7 years, 9 months ago by artandscores.
    Thread Starter artandscores

    (@artandscores)

    also, related to the latest code, w3c html validator says:

    Error: Element article not allowed as child of element span in this context. (Suppressing further errors from this subtree.)

    Thread Starter artandscores

    (@artandscores)

    – Latest solved, getting into .php, and putting <div> (instead of <span>).

    – The only thing rest is “name”, and only that i cant′t get propper value for $title (it comes empty):

    function edd_microdata_wrapper_open( $query ) {
    global $post;
    static $microdata_open = NULL;
    if( ! edd_add_schema_microdata() || true === $microdata_open || ! is_object( $query ) ) {
    return; }
    if ( $query && ! empty( $query->query[‘post_type’] ) && $query->query[‘post_type’] == ‘download’ && is_singular( ‘download’ ) && $query->is_main_query() ) {
    $microdata_open = true;
    echo ‘<div itemscope itemtype=”https://schema.org/Product”><span itemprop=”name”>’ . $title . ‘</span>’; }
    }
    add_action( ‘loop_start’, ‘edd_microdata_wrapper_open’, 10 );

    • This reply was modified 7 years, 9 months ago by artandscores.
    Plugin Contributor Pippin Williamson

    (@mordauk)

    Replace $title with get_the_title(). That should fix it.

    Thread Starter artandscores

    (@artandscores)

    Yes .. yes … YESSSS ???

    Thank you very much

    Ummm …..
    Although I see two titles, cause two schemes are followed.
    I think the product remains:

    <div itemscope itemtype=”https://schema.org/Product”><span itemprop=”name”>Agnus Dei Missa Brebis – Haan | Midi Free Download TUTTI</span><article id=”post-3790″ class=”post-3790 type-download status-publish hentry edd-download” itemtype=’https://schema.org/CreativeWork&#8217; itemscope=’itemscope’><div class=”inside-article”><header class=”entry-header”><h1 class=”entry-title” itemprop=”headline”><span itemprop=”name”>Agnus Dei Missa Brebis – Haan | Midi Free Download TUTTI</span></h1> ………</div>

    • This reply was modified 7 years, 9 months ago by artandscores.
Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘EasyDigitalDownload: microdata Product’ is closed to new replies.