shortcodes problems
-
I’m trying to use wordpress shortcodes for the bottom content of my post in my blog. I have however big problems with this.
The function I’m trying to build looks like this:
There are three attributes in the function and these should be included in the code below
function bottom_func( $atts ) {
extract( shortcode_atts( array(
‘category’ => ‘all’,
‘wine’ => ‘all’,
‘vintage’ => ‘all’,
), $atts ) );
return
‘<h3>Buy this wine – stores and prices</h3>
<div style=”padding:2px;”><span id=”ws1330668386156n” style=”font-family:inherit;font-size:inherit;font-style:normal;font-weight:normal;color:#000000;”></span><span><b>Stores</b>:</span>
</div><div style=”padding:2px;”></div><div id=”ws1330668386156″ style=”padding:2px;”>Loading… </div><script type=”text/javascript” charset=”iso-8859-1″> ws_sup_createrequest(“ws1330668386156″,”{$wine}”,”{$vintage}”,”ANY”,””,”EUR”,”A”,”false”,”inherit”,”inherit”,”inherit”,”inherit”,”inherit”,”inherit”,”5″,”normal”,”normal”,”#2500b2″,”normal”,”normal”,”#000000″,”normal”,”normal”,”#000000″)</script>
</small>Prices and store information is provided by wine-searcher.com</small>
<h3>Tasting Notes for this producer</h3>
[catlist name=”$category” tags=taste numberposts=30 excerpt=no date=yes]
<h3>Related articles</h3>
[catlist name=”$category” tags=article excerpt=yes]
‘;}
add_shortcode( ‘bottom’, ‘bottom_func’);Example:
[bottom category=”jean-grivot” wine=”Jean%20Grivot%20Echezeaux” vintage=”2009″]
Should give the following code:
<h3>Buy this wine – stores and prices</h3>
<div style=”padding:2px;”><span id=”ws1330668386156n” style=”font-family:inherit;font-size:inherit;font-style:normal;font-weight:normal;color:#000000;”></span><span><b>Stores</b>:</span>
</div><div style=”padding:2px;”></div><div id=”ws1330668386156″ style=”padding:2px;”>Loading… </div><script type=”text/javascript” charset=”iso-8859-1″> ws_sup_createrequest(“ws1330668386156″,” Jean%20Grivot%20Echezeaux”,”2009″,”ANY”,””,”EUR”,”A”,”false”,”inherit”,”inherit”,”inherit”,”inherit”,”inherit”,”inherit”,”5″,”normal”,”normal”,”#2500b2″,”normal”,”normal”,”#000000″,”normal”,”normal”,”#000000″)</script>
</small>Prices and store information is provided by wine-searcher.com</small>
<h3>Tasting Notes for this producer</h3>
[catlist name=”jean-grivot” tags=taste numberposts=30 excerpt=no date=yes]
<h3>Related articles</h3>
[catlist name=”jean-grivot” tags=article excerpt=yes]What is wrong with my code?
The topic ‘shortcodes problems’ is closed to new replies.