<?php  get_header(); ?>
    <body>

    <?php if ( have_posts() ) : 
        while ( have_posts() ) : the_post(); 
        $date = get_the_date()." ".get_the_time();
    ?>

    <script type=application/ld+json>{
        "@context":"http://schema.org",
        "@type":"Article",
        "headline":"<?=the_title()?>",
        "datePublished":"<?=$date?>",
        "dateModified":"<?=$date?>",
        "image": "<?=wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) )[0]?>",
        "author":"Dimark",
        "description":"<?=substr(get_the_excerpt(), 0,200)?>",
        "publisher":{
            "@type": "http://schema.org/Organization",
            "name": "Dimark",
            "url": "https://dimark.co/",
            "logo":{
                "@type": "imageObject",
                "url": "<?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ) ) ?>"
            },
            "mainEntityOfPage": {
            "@type":"WebPage",
            "@id":"<?=the_ID()?>"
            }
        },
    
        }
    </script>

    <script type="application/ld+json">
        {
        "@context": "https://schema.org/",
        "@type": "Product",
        "name": "<?=the_title()?>",
        "image": [
            "<?=wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) )[0]?>"
        ],
        "description": "<?=substr(get_the_excerpt(), 0,200)?>",
        "sku": "<?=$post->ID?>",
        "mpn": "<?=$post->ID?>",
        "brand": {
            "@type": "Thing",
            "name": "Dimark"
        },
        "review": {
            "@type": "Review",
            "reviewRating": {
            "@type": "Rating",
            "ratingValue": "4",
            "bestRating": "5"
            },
            "author": {
            "@type": "Person",
            "name": "Doncar"
            }
        },
        "offers": {
            "@type": "Offer",
            "url": "<?=get_permalink()?>",
            "priceCurrency": "USD",
            "price": "0",
            "priceValidUntil": "<?=$date?>",
            "availability": "https://schema.org/InStock"
        },
        "aggregateRating": {
            "@type": "AggregateRating",
            "ratingValue": "5",
            "reviewCount": "682"
        }
        }
    </script>

    <script type="application/ld+json">{
        "@context": "https://schema.org",
        "@type": "BlogPosting",
        "headline": "<?=the_title()?>",
        "description": "<?=substr(get_the_excerpt(), 0,110)?>...",
        "datePublished": "<?=$date?>",
        "datemodified": "<?=$date?>",
        "mainEntityOfPage": "True",
        "image": {
            "@type": "imageObject",
            "url": "<?=wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) )[0]?>",
            "height": "1240",
            "width": "500"
        },
        "publisher": {
        "@type": "Organization",
        "name": "Dimark",
        "logo": {
        "@type": "imageObject",
        "url": "<?php echo esc_url( wp_get_attachment_url( get_theme_mod( 'custom_logo' ) ) ) ?>"
        }
        },
        "author": {
        "@type": "Person",
        "name": "Doncar D."
        }
        }
    </script>

    <script type="application/ld+json"> {
        "@context": "http://schema.org",
        "@type": "BreadcrumbList",
        "itemListElement":
        [
        {
        "@type": "ListItem",
        "position": 1,
        "item":
        {
            "@id": "hhttps://dimark.co/blog/",
            "name": "Blog"
            }
        },
        {
            "@type": "ListItem",
            "position": 2,
            "item": {
            "@id": "<?=get_permalink()?>",
            "name": "<?=the_title()?> 🔍"
        }
        }
        ]
        }
    </script>

    <main class="article">
        <article>
            <figure>
                <?php
                    if(has_post_thumbnail()) {
                        the_post_thumbnail( 'post-thumbnails');
                    }
                ?>
            </figure>

            <h1><?=the_title()?></h1>

            <?=the_content()?>

        </article>
    </main>

    <?php  endwhile;   endif;  ?>

    <?php get_footer(); ?>

    <?php wp_footer(); ?>

    </body>
</html>
