Trying to develop a simple shortcode
-
Basically i’m trying to do a simple shortcode wherein the user can display a fixed size of an image regardless of the size. For Example [gallery] image [/gallery] it will be display like this
https://i255.photobucket.com/albums/hh140/testament1234/thumb_zps5820cef3.png
I tried coming up with my own code but looks like my codes are wrong. I’m not familiar with PHP or wordpress coding yet. I know things like this can be done using plugins but i would rather learn how to code
function image_gallery($atts, $content=null) { extract(shortcode_atts(array( 'width' => 400, 'height' => 200, ), $atts)); return '<div class="gallery"></div>'; } add_shortcode('gall', 'image_gallery' )
the styles was provided via style.css
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Trying to develop a simple shortcode’ is closed to new replies.