• Hi. In my WP site I have custom (not page builder) theme. Is it posible using selected stories into shortcode? In your documentation [web_stories_embed] has url only for one story and [web_stories] has not any attributes like story_ids or urls for selected stories (now it is showing all stories). If using page bilders I can select some stories. My problem is I can not use builder for this. How I can solve this problem?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there @degorych , thank you for reaching out with your topic. You can embed selected stories using something like:

    [web_stories title="true" excerpt="false" author="false" date="false" archive_link="false" circle_size="150" sharp_corners="false" image_alignment="right" number_of_columns="1" number_of_stories="2" view="carousel" selected_stories="1001,979/]

    You’ll want to change the selected_stories=”” values to your story IDs. To find your story ID:

    1. go to Stories Dashboard > click into the story
    2. Preview the story from the Editor
    3. In the URL, you will see something like preview_id=979
    4. Another option is to view your story, then in the developer tools, view page source and search for v1/web-story/ which will give you the story ID

    Hope this helps.

    Thread Starter degorych

    (@degorych)

    Hi @luckynasan . This is not working for me https://prnt.sc/Jc7qaE0bynKW . I don’t find any logic for this into plugin (shortcode section and story query section). I’m afraid that it is not working for shortcodes.
    My test code:

    $rows = get_field('web_stories_repeater');
    
    if ($rows) {
        $ids = array_map(function ($row) {
            return $row['story'];
        }, $rows);
    
        $webStoryShortcode = '[web_stories view="carousel" number_of_stories="2" selected_stories="' . implode(', ', $ids) . '"]';
    
        var_dump($webStoryShortcode); // [web_stories view="carousel" number_of_stories="2" selected_stories="4616,4610"]
    
        echo do_shortcode($webStoryShortcode);
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Select some stories in shortcode’ is closed to new replies.