• Resolved bizzwebpl

    (@bizzwebpl)


    Hello! Can anyone answer the question why in TablePress Extension: Chartist shortcode added to the php code like this:

    <?php
        echo do_shortcode('[table-chart id=1 /]');
    ?>

    did not work. As usual, the post adds the shortcode itself, works great, but not in php. Someone had something like that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,

    thanks for your post, and sorry for the trouble.

    Where exactly is this PHP code? You might be running it too early. The Shortcode is only registered in the init plugin hook, so you will need to run this after that, e.g. in a theme file.

    Regards,
    Tobias

    Thread Starter bizzwebpl

    (@bizzwebpl)

    …/nametheme/template-parts/profile/author-stats/dashboard.php

    access to the “profile” is only for logged in users.

    Thread Starter bizzwebpl

    (@bizzwebpl)

    It may be that the plugin needs some special part of the code that is only found in the post or page?

    Thread Starter bizzwebpl

    (@bizzwebpl)

    any ideas?

    Hi,

    not really ?? However, that file location sounds as if the table and chart would then be shown in the admin area of your site? If so, that might explain it, as the [table] Shortcode is not registered there.

    Can you therefore maybe test all this in a normal page (on the frontend)?

    Regards,
    Tobias

    Thread Starter bizzwebpl

    (@bizzwebpl)

    Hi!
    I have mastered the situation. It was enough to remove “if” from the plugin’s peaks referring to checking if the code is in the post or not. And it works ??

    Hi,

    great! ?? That’s good to hear!

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘TablePress Extension: Chartist – shortcode doesn’t work’ is closed to new replies.