S
Sean Lee-Amies
Guest
So I'm trying to figure out how to write my own shortcode, as I'm having a problem using individual shortcodes as html li tags, it ends up producing two UL's instead of placing the shortcode li's into the one ul.
HTML
<ul class="classes here">
[shortcode]<img src="" />[/shortcode]
[shortcode]<img src="" />[/shortcode]
[shortcode]<img src="" />[/shortcode]
</ul>
PHP
function portfolio_image( $atts, $content = null ) {
return ' <li>
<div class="block_holder"><div class="hover_block block_23">'. do_shortcode($content) .'<div class="circle_over"></div><div class="circle_in"></div><div class="post_info"><a href="#">VIEW IMAGE</a></div></div></div></li>';
}
add_shortcode("portfolio_image", "portfolio_image");
It'd be nice to know how to put the ul into a shortcode as well, but not overly essential. I can't seem to figure it out. Any help would be massively appreciated!
HTML
<ul class="classes here">
[shortcode]<img src="" />[/shortcode]
[shortcode]<img src="" />[/shortcode]
[shortcode]<img src="" />[/shortcode]
</ul>
PHP
function portfolio_image( $atts, $content = null ) {
return ' <li>
<div class="block_holder"><div class="hover_block block_23">'. do_shortcode($content) .'<div class="circle_over"></div><div class="circle_in"></div><div class="post_info"><a href="#">VIEW IMAGE</a></div></div></div></li>';
}
add_shortcode("portfolio_image", "portfolio_image");
It'd be nice to know how to put the ul into a shortcode as well, but not overly essential. I can't seem to figure it out. Any help would be massively appreciated!