I want to convert this shortcode.
[list-style="one"]
a
b
c
d
[/list-style]
To ouput like this one (html form)
<ul class="one">
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</ul>
I want to convert this shortcode.
[list-style="one"]
a
b
c
d
[/list-style]
To ouput like this one (html form)
<ul class="one">
<li>a</li>
<li>b</li>
<li>c</li>
<li>d</li>
</ul>
Comments are closed.
First off, your shortcodes are not formatted correctly for WordPress.
You need to have a tag for your shortcode and then define the attributes separately.
Instead of
[list-style="one"][/list-style]
it needs to be something like[list class="one"][/list]
The following code will add two shortcodes to your WordPress install.
[list]
and[li]
You would then use these like so:
[list class="one"][li]A[/li][li]B[/li][li]C[/li][li]D[/li][/list]
My code also allows you to also..
Define an ID attribute:
[list id="someid"]
Define the list type:
[list type="ol"]
For this code to work, add it to your theme’s functions.php file or create a plugin out of it.