Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Danny van Kooten

    (@dvankooten)

    Hello @nicmare,

    The block from the screenshot is a widget, so it will only show up if your theme has available widget areas.

    To insert such a list in a post or page, you should be able to use the [koko_analytics_most_viewed_posts] shortcode.

    For this, you add the “Shortcode” block to your editor and then insert the name of our shortcode, including the square brackets.

    Let me know if that doesn’t help please.

    Danny

    Thread Starter nicmare

    (@nicmare)

    thank you for the quick answer danny.

    the shortcode does output nothing for me:

    and why not adding the widget block as a regular gutenberg block to the regular page editor?

    Plugin Support Lap

    (@lapzor)

    Under Dashboard > Analytics, in your Wp Admin, is it showing the most viewed posts there?

    Plugin Author Danny van Kooten

    (@dvankooten)

    Hello @nicmare,

    We simply haven’t got around to it yet. Adding a shortcode is much less work than adding a Gutenberg block. It’s also quite low priority for us, as people would usually want to show these kinds of stuff in their sidebar or footer, not necessarily from inside a post or page.

    Now I am not sure why the shortcode isn’t working for you though. I can’t spot any issues with your shortcode, so something on your site must be breaking the use of shortcodes… I’m sorry I can’t be of more help there.

    Thread Starter nicmare

    (@nicmare)

    thats my wp-admin dashboard:

    Thread Starter nicmare

    (@nicmare)

    i mean i do not really need it but was curious to give it a try when i discovered that

    Plugin Author Danny van Kooten

    (@dvankooten)

    Thanks @nicmare. Really strange… Can you check the source of the post with the try-out shortcode on it to see if there is an empty <ul> element there?

    By default the shortcode only includes posts with the “post” post type, so perhaps your website doesn’t have any posts, only pages?

    Thread Starter nicmare

    (@nicmare)

    ah alright that was the reason. the <ul> was indeed empty and i have only one post but mostly using a custom post type so this does the trick for me:

    [koko_analytics_most_viewed_posts number=5 days=30 post_type="set" show_date="false"]

    thanks for the heads up! Maybe include an if/else statement with a notice if no posts where found like in my case. thank you very much once again!

    Thread Starter nicmare

    (@nicmare)

    btw when using show_date="false" as described in docs, it does the opposite. it prints the date.

    Plugin Author Danny van Kooten

    (@dvankooten)

    thanks for the heads up! Maybe include an if/else statement with a notice if no posts where found like in my case. thank you very much once again!

    @nicmare

    I’ve added that – if your shortcode arguments did not lead to any results and you’re logged in with the ability to edit_posts, you’ll now see the following heads up:



    Heads up! Your shortcode is working, but did not return any results. Please check your shortcode arguments.

    Hopefully that saves someone a moment of scratching their head.

    btw when using show_date="false" as described in docs, it does the opposite. it prints the date.

    @nicmare

    I’m afraid that is due to a bit of weird behavior on WordPress’ shortcode_atts function. It interprets the “false” string as being true. We’ll update our knowledge base article, our bad!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘widget does not appear’ is closed to new replies.