• Resolved Isabel Pinhel

    (@isabelpinhel)


    Hi there,

    I am using the following code in a page to load the current user’s ranks:

    <?php echo do_shortcode('[gamipress_ranks type="social,reviewer,writer,translator,chef,volunteer" orderby="priority" order="DESC" exclude="9865,9873,9882,75650,10180,9889" layout="none" title="yes" toggle="no" link="no" excerpt="no" requirements="no" user_id="' . $userid = get_current_user_id() . '"]'); ?>
    

    Of the shortcode attributes above, 3 are not working: orderby, order and exclude. Ranks are being ordered according to the order they were listed in attribute “type” and no ranks were excluded. I used the rank post IDs that I wanted to exclude for the “exclude” attribute.

    Is this a bug or am I not using the shortcode correctly?

    Many thanks in advance,
    Isabel

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Ruben Garcia

    (@rubengc)

    Hi @isabelpinhel

    I just checked this shortcode and everything is working correctly, custom order, exclude so have you checked that the ranks IDs you provide are the correct ones?

    Anyway, you have here the full list of attributes supported with their expected values:
    https://gamipress.com/docs/shortcodes/gamipress_ranks/

    Also, you have the [gamipress_user_rank] shortcode that lets you display the current, previous and next rank to your users (hidding the other ones):
    https://gamipress.com/docs/shortcodes/gamipress_user_rank/

    Hope it helps

    Thread Starter Isabel Pinhel

    (@isabelpinhel)

    Hi @rubengc

    For the rank IDs, I am using the post ID of the rank – please could you confirm this is correct? I checked the code and it seemed to me to be so.

    Also, in your test, did you specify ranks in the “type” attribute or did you use the value “all”?

    Thread Starter Isabel Pinhel

    (@isabelpinhel)

    Also, is there a sandbox I could test this on? I can not work out why I am not getting the expected behaviour.

    Plugin Author Ruben Garcia

    (@rubengc)

    Hi @isabelpinhel

    Yes, I tested this with several different settings (all types, handpicked types, excluding ranks from different types, custom order) and all tests worked correctly

    About the ID, yes, is the post ID since ranks are WordPress posts

    About the sandbox, we don’t offer such service, but commonly hosting provides has the staging site feature (that lets you make a copy of your site for test purposes)

    Also, you mention that you use his way (PHP) to render the shortcode with the current user ranks, but, did you noticed that our ranks shortcode has the current_user attribute designed to render the ranks information based on the current user?
    https://gamipress.com/docs/shortcodes/gamipress_ranks/

    Also, there is the user rank shortcode, that brings you an easy way to display the current, previous and next user rank:
    https://gamipress.com/docs/shortcodes/gamipress_user_rank/

    Hope it helps

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[gamipress_ranks] shortcode: several attributes not working’ is closed to new replies.