wp_shortcode add product image fadein and fadeout

// [product pro_id=”1″ img_url=”” img_tit=”product name” doc_url=”#” content=””]
function product_info($atts, $content = null) {
extract(shortcode_atts(array(
‘pro_id’ => ‘1’,
‘img_url’ => ‘img/image.jpg’,
‘img_tit’ => ”,
‘doc_url’ => ‘#’,
‘content’ => ‘text text text….’,
), $atts));

$img_tit_union = str_replace(” “, “-“, $img_tit);

$code = ‘

Product image thumbnail
Click here to see Product ‘ . $pro_id . ‘ brief info
Click here to download PDF info
download icon

</div>
</div>

‘ . $img_tit . ‘ ‘ . $pro_id . ‘

' . ucwords($img_tit) . '‘ . $content . ‘

‘;

return $code;
}

add_shortcode(‘product’, ‘product_info’);

Posted October 18, 2011 by Qingli in My blog