Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author diegoquinteiro

    (@diegoquinteiro)

    Hi alexkap, thanks for reaching out!

    Can you paste the debug output from your Instant Articles box on the post view here?

    Then I’ll try to figure out the best way to address it.

    Thanks!

    Thread Starter alexkap

    (@alexkap)

    Hi diegoquinteiro. It’s ok i solved it.

    It was something like this:

    <header>
    	<figure>
    		<img src="https://www.example.com/wp-content/uploads/image-src.jpg"/>
    	</figure>
    	<h1>Header 1</h1>
    	<time class="op-published" datetime="2016-02-15T20:54:34+02:00">February 15th, 8:54pm</time>
    	<time class="op-modified" datetime="2016-04-13T18:10:35+03:00">April 13th, 6:10pm</time>
    	<h3 class="op-kicker">Header 3</h3>
    </header>
    	<figure>
    		<img src="https://www.example.com/wp-content/uploads/image-src-508x183.jpg"/>
    	</figure>
    	<p>Texth here</p>

    On header the image src was “image-src.jpg” but on content it was “image-src-508×183.jpg”. So facebook displayed twice the same picture and i was getting general warning for this issue.

    With preg replace i removed widthxheight from image src, so facebook displays once each image with no general warnings.

    Thanks @alexkap. I’m not going to mark this as resolved just yet. While your solution works, perhaps there’s something we can change to prevent this from happening to others.

    Could you share your current debug output (both left+right sides: Source + Transformed Markup)?

    I’m also curious where you performed the preg replace.

    Thread Starter alexkap

    (@alexkap)

    Hello demoive. Thanks for you reply.

    The source code of a single article is something like that:

    <img class="alignnone size-large wp-image-8265" src="https://www.example.com/wp-content/uploads/my-image-508x246.jpg" alt="my-image" width="508" height="246"/>
    <p>first paragraph</p>
    <p>second paragraph</p>

    The transformed markup for above lines of code is this:

    <figure>
    	<img src="https://www.example.com/wp-content/uploads/my-image.jpg"/>
    </figure>
    <p>First paragraph</p>
    <p>Second paragraph</p>

    I performed the preg replace on function “get_the_content()” of “class-instant-articles-post.php” just before returning the variable $this->_content;

    Hey alexkap,

    you should use two different images. use one image in the article and use another image to set as featured image. using same image is violation of instant article policy. ( I recommend you)

    or

    use one image for set featured image and don’t include any image in the article if you can’t find two images for each article. but this method bad for web experience.

    Thanks for the collaboration and feedback on this issue. I’m marking it as “Resolved”.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Same image displayed twice’ is closed to new replies.