Other Shortcodes not working

I have the membership plugin set up and I’m using shortcodes to hide content for non members. I have a different plugin installed that allows me to use shortcodes on a page to display certain content. When I am logged in as the admin, or not logged in at all, the content shortcode works. But once I log in as a member, it displays nothing.

I have tried this on a page with protected content, and a completely free page, and both act the same. It works fine until I log in as a member.

I have the option to show all shortcodes by defualt and the content shortcode is does not have a negative rule on it, so that isn’t it. In fact, if I put a negative rule on the shortcode, it gives me my “you need to be a member” text.

I tried disabling the plugin and the shortcodes work fine when membership is disabled, and logged in as the same user.

  • BlackSnowMedia
    • Flash Drive

    It works the same either way. Even if I take out the protected shortcode completely the other shortcode doesn’t work.

    Just to possibly help, the shortcode I am using is to display posts from a category on a page. I just ran into another problem on a different site I was working on where 2 loops wouldn’t work on the same page unless I put in this line after the loop:

    wp_reset_query();

    Could this be the problem, maybe when the user is logged in as a member it’s messing with this other query and just not displaying anything? Just a thought

  • Philip John
    • DEV MAN’s Apprentice

    Okay, so is it just this content shortcode that doesn’t work? What about other shortcodes like [gallery], for example?

    That’ll tell us whether it’s just this plugin.

    Yep, wp_reset_query() is needed if you have multiple loops. If the plugin you’re using isn’t managing that properly that could cause issues…

    Phil

  • BlackSnowMedia
    • Flash Drive

    OK I tried a different shortcode and it worked. So I went into the plugin and the wp_reset_query was in there at the end. I tried adding it before the loop at well and nothing changed. The plugin is “Display Posts Shortcode” if you wanted to check it out at all.

  • BlackSnowMedia
    • Flash Drive

    I just added a plug that lets you put your own php in using a shortcode. I made my own code and tried it, and it doesn’t work (when logged in as the memeber) here is the code.

    // Reset Query
    wp_reset_query();
    // The Query
    query_posts( 'category_name=bodybuilding' );

    // The Loop
    while ( have_posts() ) : the_post();
    echo '<li>';
    the_title();
    echo '</li>';
    endwhile;

    // Reset Query
    wp_reset_query();

  • Mason
    • DEV MAN’s Sidekick

    Hiya,

    Just checking if it was eventually resolved in another thread? Or by yourself separately to us? Or by us over email with you? Or using our live support?

    If so, no need to reply, that’s great news.

    If not, could you let us know by re-opening this topic, and we’ll get onto it and helping you out asap!

    Otherwise, happy days, glad you got it sorted :slight_smile:

    Thanks!

    p.s. I’ve also tagged Barry here in case you do reopen this, as they’ll definitely be able to help you!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.