• Resolved Paweł Patyk

    (@paulmike)


    A great plugin, but it’s sorely lacking a basic feature: the ability to display posts in a story without dividing them into categories – each story is a single post.

    I’d like that option, please 🙂

    In the ‘admin’ section of the control panel, I added one test section and one relationship, but they do not appear on the page after adding the code:
    <?php echo do_shortcode('[snap-tales mode="admin"]'); ?>

    • This topic was modified 2 days, 17 hours ago by Paweł Patyk.
    • This topic was modified 2 days, 17 hours ago by Paweł Patyk.
    • This topic was modified 2 days, 17 hours ago by Paweł Patyk.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Halil Beycan

    (@beycandeveloper)

    Hi Pawel,

    Thanks for the kind words!

    On “each story is a single post”

    The category grouping is intentional — it mirrors how Instagram itself works. On Instagram a circle is a user, and the stories inside it belong to that user. In Snap Tales the category plays exactly that role: the circle is the category, and the posts marked as stories inside it are the individual stories.

    If every post became its own circle, you’d end up with a long row of circles that each contain exactly one story, and there would be no sensible label under them — a post title is far too long for a story circle, unlike a category name. That’s why the grouping exists.

    If you want fewer, more curated circles, you can shape it with categories: create a category per topic and only enable “Story visibility” on the posts you actually want to appear.

    On the admin mode not showing anything

    Let’s get to the bottom of that. Two things would help me:

    1. Your database version. WordPress → Tools → Site Health → Info → Database → “Server version” (e.g. MariaDB 10.4 or MySQL 8.0). The admin stories query uses a JSON aggregation function that MariaDB versions below 10.5 don’t support — on those it silently returns nothing, with no visible error.
    2. A link to the page where you added the shortcode, plus the browser console output. Open that page, press F12 → Console tab, reload, and paste anything red you see (or a screenshot). The shortcode itself only prints an empty container; the stories are loaded into it afterwards by JavaScript, so the console usually points straight at the problem — most often a caching or JS-optimization plugin interfering with the script.

    Also, please double-check in the admin list that both the story box and the story are set to Active.

    Best regards

    Thread Starter Paweł Patyk

    (@paulmike)

    I’ve rewritten the plugin’s code so that it displays the posts selected in the dashboard as separate entries, without dividing them into categories.
    It was very difficult, as you also have to edit the app.min.js file, because there isn’t a readable app.js file 🙁

    Server version: 10.4.34-MariaDB

    Thanks for the explanation and your help.

    Fixed: MariaDB compatibility on the story queries

    Thread Starter Paweł Patyk

    (@paulmike)

    Thanks.
    I would also ask you to share the app.js source file 🙏

    That file has nothing to do with this issue. Why do you want it?

    Thread Starter Paweł Patyk

    (@paulmike)

    I edited this file when I wanted to display stories as separate posts, without dividing them into categories, and so that the entire story in the pop-up would be a link and the post title would appear at the bottom, rather than just a link at the bottom (which isn’t visible, as you can see in the Chrome toolbar on a mobile phone), without a title (just the category name)…

    Thanks, that explains it. The good news is you don’t need to touch app.min.js for
    any of these — here’s how each one can be done without forking the plugin.

    1. One story per post, no category grouping

    This is already possible in PHP. The shortcode doesn’t hardcode its data source:
    each “mode” is a class that builds the story-box structure, and the mode list runs
    through a filter. So you can register your own mode with your own query and use it
    as [snap-tales mode=”single-post”]. Plugin core stays uking.

    use BeycanPress\SnapTales\Types\StoryBox;
    use BeycanPress\SnapTales\PluginHero\Hook;
    use BeycanPress\SnapTales\PluginHero\Helpers;
    use BeycanPress\SnapTales\Shortcode\Modes\Mode;

    class SinglePostMode extends Mode
    {
    public string $id = ‘single-post’;

    protected function prepareStruct(): array { $boxes = []; $query = new \WP_Query([ ‘post_type’ => ‘post’, ‘post_status’ => ‘publish’, ‘posts_per_page’ => 20, ‘meta_query’ => [[ ‘key’ => ‘snap_tales_story_visibility ‘value’ => ‘on’, ]], ]); foreach ($query->posts as $post) { $mediaURL = get_post_meta($post->ID, ‘snap_ ?: get_the_post_thumbnail_url($post->ID); $story = [ ‘id’ => $post->ID, ‘parentId’ => $post->ID, ‘mediaURL’ => $mediaURL, ‘createdAt’ => $post->post_date, ‘updatedAt’ => $post->post_modifie ‘userId’ => absint($post->post_author), ‘externalURL’ => get_the_permalink($ ‘createdTimeAgo’ => Helpers::dateToTimeAgo($post->post_date), ]; $boxes[] = StoryBox::fromArray([ ‘stories’ => [$story], ‘id’ => $post->I ‘title’ => get_the_title($post), ‘thumbnail’ => $mediaUR ‘updatedAt’ => $story[‘updatedAt’], ‘createdAt’ => $story[‘ ‘redirectURL’ => $story[‘externalURL’], ‘lastStoryCreatedTimeAgo’ => $story[‘ ‘lastStoryCreatedTimestamp’ => strtotime($story[‘createdAt’]), ]); } return $boxes; }

    }

    Hook::addFilter(‘register_modes’, function (array $modes): array {
    $modes[] = new SinglePostMode();
    return $modes;
    });

    Hook::addFilter() prefixes the hook name with the plugiass
    just ‘register_modes’. Put this in your child theme’s functions.php or a small
    mu-plugin. As a side effect it also fixes part of your post
    per box, the label is the post title instead of the category name.

    1. Making the story area clickable

    You can get part of the way there with CSS alone, no JS edits. The app renders inside
    an open shadow root, so you can reach it and push your

    document.addEventListener(‘DOMContentLoaded’, () => {
    const host = document.getElementById(‘snap-tales-single-post’);
    const sheet = new CSSStyleSheet();
    sheet.replaceSync( .story-box-view .footer { inset: 0; top: auto; .story-box-view .footer a { display: block; height: 100%; } );
    host.shadowRoot.adoptedStyleSheets.push(sheet);
    });

    One caveat: the story surface is also the tap target fohing
    the link across the whole frame will swallow that navigation. That’s exactly why it
    isn’t the default — a larger bottom hit area is the san

    1. The bottom link hidden behind the mobile browser too

    That one is a genuine bug, not a customisation, and it
    Chrome — not just you. I’m logging it and it’ll be fixed in an upcoming release.

    And yes, I’ll be adding more hooks over time so cases like yours don’t require
    editing plugin files at all.

    Best regards

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.