• Hello,

    I have added my custom post type using this in my functions.php file

    add_filter( 'instant_articles_post_types', 'add_post_types', 10,1 );
    function add_post_types($post_type_array){
    	array_push($post_type_array,'recipes');
    	return $post_type_array;
    }

    The custom post type is showing up, but this post type has most of it’s information stored in the _postmeta table with keys ‘_recipe_ingredients’ or ‘_recipe_directions’. How might I include specific _postmeta for my recipes custom post type?

    Thanks

Viewing 1 replies (of 1 total)
  • Try with this example..

    use Facebook\InstantArticles\Elements\Footer;
    use Facebook\InstantArticles\Elements\Paragraph;
    use Facebook\InstantArticles\Elements\Bold;
    use Facebook\InstantArticles\Elements\Italic;
    use Facebook\InstantArticles\Elements\Anchor;
    use Facebook\InstantArticles\Elements\Ad;
    add_action( ‘instant_articles_after_transform_post’, ‘place_p’);
    function place_p($ia_post) {
    $ia = $ia_post->instant_article;
    $ia->withFooter(
    Footer::create()
    ->withCredits(‘Some plaintext credits.’)
    );
    $ia->addChild(
    Paragraph::create()
    ->appendText(‘@copyright’)
    );
    }

    and other rule…in this link… hope enjoy it.

    https://developers.facebook.com/docs/instant-articles/sdk/elements?__mref=message_bubble

Viewing 1 replies (of 1 total)
  • The topic ‘add meta info for custom post type’ is closed to new replies.