• Resolved krishanakant

    (@krishanakant)


    I am trying to use the [pmpro_levels] using <?php echo do_shortcode(‘[pmpro_levels]’);?>
    but that is not rendering on the custom -post-type single-posttype custom template.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Andrew Lima

    (@andrewza)

    Hi @krishanakant

    Thank you for using Paid Memberships Pro.

    You aren’t able to use the do_shortcode call as it’s not an actual shortcode. A workaround would be to use the Advanced Levels Shortcode Add On – https://www.paidmembershipspro.com/add-ons/pmpro-advanced-levels-shortcode/

    Once this is activated you may use the advanced shortcode instead.

    If you’d like to test this Add On for free, you may visit https://www.paidmembershipspro.com/free

    I’ve been trying to use the [pmpro_levels] shortcode as well using the free Pait membership Pro plugin and it doesn’t work. However [pmpro_members .. ] shortcodes work on the same setup and enviroment.

    So what could be the problem?

    Based on @andrewza ‘s reply is it safe to assume that you have to get the paid version of pmpro just to be able to list the memberships?

    Plugin Author Andrew Lima

    (@andrewza)

    You can manually create the level output using a custom table and directly linking to the checkout. The reason the [pmpro_levels] isn’t working in the do_shortcode() method is that it’s not a ‘real’ shortcode.

    As mentioned above, the Advanced Levels Shortcode would be a workaround as that’s a WordPress shortcode. You can use this for free, by visiting https://www.paidmembershipspro.com/free (as we are 100% GPL).

    Hi @andrewza,

    I found this thread when I was looking into why I couldn’t get shortcodes such as pmpro_checkout to work in a template file with do_shortcode(), despite them working in the default post editor and in a custom field.

    When you say it’s not a “real” shortcode, what do you mean? It’s really confusing, as in the docs it’s mentioned that you can use shortcodes within template files (and indeed, as a test, I got a user email to appear using [pmpro_member field=”last_name”] within a template). So are you saying that you can only use some shortcodes in templates? If so, which ones? It’s very misleading in the docs.

    Second to that, is it possible to call the membership checkout form within a template file, or do you have to link to the page where the “shortcode” is added?

    Many thanks

    Rob

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to use shortcode’ is closed to new replies.