• Resolved arun88000

    (@arun88000)


    I need to add MediaGallery Schema on Web stories, How can I get

    “thumbnailUrl”:”image thumbnail url ”,
    “name”:”Name of slide “,
    “description”:”Description of slide “,

    I am using web_stories_story_head hook to enter the custom schema

    Structure of the MediaGallery Schema

    {
    
    "@context" : "https://schema.org",
    
    "@type": "MediaGallery",
    
    "description”:”Description of story”,
    
    "mainEntityOfPage": {
    
    "@type": "ImageGallery",
    
    "associatedMedia":[
    
    {
    
    "@type": "ImageObject",
    
    "thumbnailUrl”:”image thumbnail url ”,
    
    "name”:”Name of slide ",
    
    "description”:”Description of slide ",
    
    “contenturl”:”Image url“
    
    }

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pascal Birchler

    (@swissspidy)

    There is not a straightforward way to get all images in a story the way you want them.

    Want you could try to do is parse the JSON data we store in post_content_filtered to loop through all the pages and find the image elements to extract. The data format is not really documented though, so I can’t give you more pointers.

    NB: The?web_stories_story_head?action is more for add additional HTML to the head. The Web Stories plugin already adds schema by default, so I’d recommend using the?web_stories_story_schema_metadata?filter instead to modify the existing schema data emitted by the Web Stories plugin. The filter provides the current $post as a second argument, so you can access $post->post_content_filtered.

    Thread Starter arun88000

    (@arun88000)

    post_content_filtered showing json but that does not contain images that we are using in web stories slides

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @arun88000 That site made my malware scanner cry tears of rage. Please do not share that site again. I have archived your reply; that is not a safe site.

    If you need share that data please use https://gist.github.com/ or https://pastebin.com/ instead and post the link to that paste.

    Plugin Support Luckyna San

    (@luckynasan)

    @arun88000 Since there hasn’t been a response, we’ll regard your topic as resolved. Should you have any further questions or encounter additional issues, feel free to initiate a new topic.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need to add MediaGallery Schema on Web stories’ is closed to new replies.