<img class="orbt" onmouseover="MM_swapImage('full','','http://demo/demo.jpg',1);MM_setTextOfLayer('text','','<div class="dress-text"><strong>Malyse<br /></strong><p></em></p></span></div>');var theImg = document.getElementById('full');var thediv = document.getElementById('container1');thediv.style.pixelHeight=parseInt(theImg.height)+200;" src="http://demo/demo.png" alt="Malyse" width="81" height="81" />
A blog that caters the needs as Magento Tutorial for Magento freshers. One can find helps related to Magento issues. Many Magento Extensions and Magento Modules are discussed in this blog. The blog author has himself developed many Magento extensions and has experience of 40+ Magento websites.
Friday, March 25, 2011
Different Sidebar for wordpress pages
Often one needs different sidebars for different pages in wordpress. This can be implemented using the below mentioned code.The logic used here is that we get the post id and assign sidebar based on their id's.
<div id="sidebar">
<?php
global $id;
$post_id_current = get_post($id,ARRAY_A);
$post_parent = $post_id_current['post_parent'];
if($post_parent!='')
{
$my_id=$post_parent;
}
else
{
$my_id=$id;
}
if($my_id!==4 )
{
if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('sidebar2') ) : endif;
}
else
{
if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('sidebar1') ) : endif;
}
?>
</div>
<div id="sidebar">
<?php
global $id;
$post_id_current = get_post($id,ARRAY_A);
$post_parent = $post_id_current['post_parent'];
if($post_parent!='')
{
$my_id=$post_parent;
}
else
{
$my_id=$id;
}
if($my_id!==4 )
{
if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('sidebar2') ) : endif;
}
else
{
if ( !function_exists('dynamic_sidebar')
|| !dynamic_sidebar('sidebar1') ) : endif;
}
?>
</div>
Subscribe to:
Posts (Atom)