WordPress.org

Ready to get started?Download WordPress

Forums

shortcode question (5 posts)

  1. mxpimp47
    Member
    Posted 3 years ago #

    i want to create a shortcode that will control a heading, and list within a div.

    i have the shortcode created and i cant target the elements in the shortcode at all. only the div and that is it.

    maybe i have a misconception of what i can do with shortcodes....

    could someone please lead me in the right direction for what im trying to achieve, it would be greatly appreciated!

    http://pastebin.com/vNtXTQLs

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    i want to create a shortcode that will control a heading, and list within a div.

    you have the div;

    what heading?

    what list?
    what is the list supposed to list?

    you can do a lot of stuff with shortcodes (see the gallery shortcode for instance), only make sure to return the result, and don't use anything in the code that would echo something.

  3. mxpimp47
    Member
    Posted 3 years ago #

    i want to type the heading and list between the shortcode like this maybe -

    [services]
    <h4>heading</h4>
    <ul>
    <li>list item</li>
    <li>list item</li>
    </ul>
    [/services]

    or do i have to specify the heading tag and list in the shortcode function?

  4. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    only seems to work if you add your shortcode into the post editor in html mode; visual mode seems to mess with the html tags.

  5. mxpimp47
    Member
    Posted 3 years ago #

    i have setup this shortcode with the twentyten theme and it doesnt work in html mode.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags