Support » Plugin: Random Content » Using shortcode in template file

  • Hi there,

    Thanks for developing this simple to use, and lightweight plugin.

    I have been using it successfully for a few weeks now on a client’s website while adding the shortcode via the admin. Now, however, there is a page that won’t allow for the shortcode to be added this way. Instead, I need to add it via the page template file. However, adding the php below does not work.

    <?php echo do_shortcode('[random_content group_id="12"]'); ?>

    I am guessing that I am doing something wrong, but, I am afraid, I can’t work out what. In case it helps, the following does work fine:

    <?php echo do_shortcode('[logocarousel id="150"]'); ?>

    Any help you can offer would be most appreciated.

    With kind regards,

    Mark @ SYPO

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jeremy Green


    Does the shortcode output anything when using do_shortcode, or is it simply blank?

    Hi Jeremy,

    Thanks for getting back to me.

    When using do_shortcode in a php template file, it just outputs nothing at all.

    With kind regards,


    • This reply was modified 8 months, 1 week ago by SypoMark.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Using shortcode in template file’ is closed to new replies.