Forum Replies Created

Viewing 1 replies (of 1 total)
  • @itagility
    I had the same problem. Solved by adding this function to my theme’s functions.php:

    add_filter(‘instant_articles_transformed_element’, ‘my_subtitle’, 10, 1);

    //the filter is provided by the fb-instant-articles plugin
    //it passes in the instant_article object, which you can modify
    //before it finishes rendering the feed.
    function my_subtitle($article) {
    global $post;
    $my_subtitle = get_the_excerpt(); //replace this with whatever

    //the instant article has a Header element, which has a subtitle property.
    //Get it and add a subtitle
    $subtitle = $article->getHeader()->withSubTitle($my_subtitle);

    //return the modified instant article back into the render flow
    return $article;

    //verify that your /feed/instant-articles contains <h2>’s in each feed item <content> elements.
    }

    • This reply was modified 8 years, 2 months ago by fabianomoreau.
Viewing 1 replies (of 1 total)