Support » Plugin: Hammy » Add Microdata to Original Image

  • Hi There, I am hoping that you can help me to add data to the output of the hammy plugin.

    <a href="">
    <picture class="hammy-responsive alignnone size-large wp-image-90074" alt="image" title="">
      <source src="">
      <source src="" media="(min-width:120px)">
      <source src="" media="(min-width:150px)">
      <source src="" media="(min-width:320px)">
      <source src="" media="(min-width:480px)">
      <img src="" alt="image" title="">

    So what I basically need to do is add the itemprop="image"
    to the output <a href="" itemprop="image">

    Your help will be much appreciated

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Noel Tock


    Hi Gerald,

    I think this makes sense, I’ll chuck in an option for that I think, this way people who aren’t using schema don’t need unnecessary DOM in their code.


    Excellent – Thanks Noel much appreciated – I have in the meantime added this to my function file…

    function my_remove_rel_attr($content) {
        return preg_replace('/\s+rel="attachment wp-att-[0-9]+"/i', ' itemprop="image" ', $content);
    add_filter('the_content', 'my_remove_rel_attr');

    which basically adds the itemprop="image" code on the link to the image…

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Microdata to Original Image’ is closed to new replies.