WordPress.org

Ready to get started?Download WordPress

Forums

Shortcodes Pro
[resolved] attributes_slug not working (7 posts)

  1. DickRaney
    Member
    Posted 3 years ago #

    Attribute slugs are not being populated with their values as specified in the shortcode settings. The content portion works, but the attribute_slug tag does not get replaced by a value.

    Here is what I specified for my text attribute options
    Third|third,Last|last

    This is what I am using for the HTML code
    <div class="%%attribute_slug%%">%%content%%</div>

    But all I get in the generated page is
    <div class="%%attribute_slug%%">sample text for column here.</div>

    http://wordpress.org/extend/plugins/shortcodes-pro/

  2. tastingtheweb
    Member
    Posted 3 years ago #

    Avoid text separations of any kind (e.g. comma, slash, underscore) in attribute names and it will work just fine.

  3. DickRaney
    Member
    Posted 3 years ago #

    I don't have any separations in the attribute names and it still isn't working.

    Here is what I have for my attribute settings:
    Slug: type
    Label: Type
    Type: Select
    Options: Third|third,Last|last
    Default Value: third
    Description: Makes columns

    Pretty simple, but it just puts the attribute tag into the page.

    Thanks for your help!!!!

  4. Matt
    Member
    Plugin Author

    Posted 3 years ago #

    Hi Dick,

    The %%atribute_slug%% refers to the slug you enter when adding an attribute, in your case the attribute_slug of Type is "type".

    So instead of:

    <div class="%%attribute_slug%%">%%content%%</div>

    You should use:

    <div class="%%type%%">%%content%%</div>

  5. DickRaney
    Member
    Posted 3 years ago #

    THANKS!! That did the trick.

    Maybe I would have figured that out if I was using more than one attribute, since there would be no other way to differentiate which attribute I wanted.

    Anyway, I appreciate your help and think it is a great plugin.

  6. DickRaney
    Member
    Posted 3 years ago #

    FYI, I went back and tested it using dashes as separators in the attribute values and it works just fine.

  7. Matt
    Member
    Plugin Author

    Posted 2 years ago #

    Excellent, glad to hear that :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic