Viewing 3 replies - 1 through 3 (of 3 total)
  • I am going mad trying to make it work. So far I have been unable to automatically include “data-feedback=”fb:likes, fb:comments”” into my FBIA. I tried adding custom transform rules, to change the json file, to dig into ALL files included in the plugin….no luck.
    The Allfacebook IA plugin has a simple checkbox to to that, yet its code structure is very different from the Instant Articles for WP plugin and I was unable to replicate this function.
    I suspect it would be a matter of minutes for the developers to include this basic option or to explain us what we have to change in the code to get it work. Yet, this plugin’s support is simply horrendous….:(

    Hola, tengo una solución…

    Entra a: /plugins/fb-instant-articles/vendor/facebook/facebook-instant-articles-sdk-php/src/Facebook/InstantArticles/Elements/Image.php

    Línea 307 aprox.

    $element = $document->createElement(‘figure’);
    //—->Agrega la línea de abajo
    $element->setAttribute(‘data-feedback’, ‘fb:likes,fb:comments’);

    //—->Comenta las siguientes líneas
    // Like/comments markup optional
    /*
    if ($this->isLikeEnabled || $this->isCommentsEnabled) {
    if ($this->isLikeEnabled && $this->isCommentsEnabled) {
    $element->setAttribute(‘data-feedback’, ‘fb:likes,fb:comments’);
    } elseif ($this->isLikeEnabled) {
    $element->setAttribute(‘data-feedback’, ‘fb:likes’);
    } else {
    $element->setAttribute(‘data-feedback’, ‘fb:comments’);
    }
    }*/

    Listo!!
    Eso te ayudará a que todas las imágenes tengan el data-feedback (:
    Espero que te ayude 😀

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Data feedback on images and videos’ is closed to new replies.