Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter schemaishard

    (@schemaishard)

    Hi bcworkz,

    Thanks for your help with this.
    Makes sense what you’re saying and I updated the code with your code. I think i’m getting closer.

    Unfortunately the simillar article images are still picking up the header image width and height tags. And googles schema tester shows the same height and width for the main header image and the simillar articles images. My simillar article images are only thumbnail sizes.

    I am starting to wonder if I shoud be looking at using an “if” statement to target only the header image

    Thread Starter schemaishard

    (@schemaishard)

    To give some more background:

    I am currently editing my functions.php file to get schema to be inserted into the various relevant sections of my page. And one of the sections is the <img> tag. on the blog post pages the header image at the top displays and I insert the schema into that <img> tag using the above code. But on that page I also have the relevant content images at the bottom of the post. The code above seems to be inserting the main image width and height schema into the relevant article images width and height as well. I think I am targeting the wrong function.

    Forum: Hacks
    In reply to: adding schema to post date
    Thread Starter schemaishard

    (@schemaishard)

    the code is from a plugin that takes the data from using the get_the_time function

    Forum: Hacks
    In reply to: adding schema to post date
    Thread Starter schemaishard

    (@schemaishard)

    Thank you for your help bcworkz. It was much apprecited. After about 4 days of trial and error, with your help I was able to decode how these filters work. In the end this is the code I ended up with

    add_filter('cherry_get_the_post_date', 'schema_cherry_get_the_post_date', 10, 3 );
     function schema_cherry_get_the_post_date( $output) {
     $opening_schema = ' itemprop="datePublished" ';
     return  '<span' . $opening_schema . $output . '</span>';
    }

    Again, thanks mate!

    Forum: Hacks
    In reply to: adding schema to post date
    Thread Starter schemaishard

    (@schemaishard)

    Thanks for the reply,

    Is there a way I can get the html from the get_the_date function and then add my own html to it?

Viewing 5 replies - 1 through 5 (of 5 total)