On my site I am using a 4 column template, and that is the only one available for people with sub sites. Within this, I want to allow them to change 2 side-bars, but have 1 side bar, with a search function and my Google-ads, permanently fixed. Is that possible to set somewhere?
yes, remove the dynamic sidebar code. remove this:
'<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>'
this will de-widgetize that sidebar. then code it however you want.
Or put the code you don't want them to change outside of that code above or the php end if at the end of the sidebar.
I do this with a counter plugin we have.
Like this:
'<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar() ) : else : ?>'
widgetized sidebar stuf
< end if soemwhere>
Then add your code.
Thank you demonicume. I have tried that, but it removes the whole side bar and gives an error: "Parse error: syntax error, unexpected T_ENDIF in"
The code is: <div id="r_sidebar"> <ul id="l_sidebarwidgeted"> <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
<?php include (TEMPLATEPATH . '/searchform.php'); ?> <?php endif; ?>
</div>
Which part do I remove to keep the search in that column?
You don't remove it - you just MOVE it. demonicume was incorrect. To keep the search but still have things widgetized, do this:
<div id="r_sidebar">
<ul id="l_sidebarwidgeted">
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
<?php endif; ?>
<?php include (TEMPLATEPATH . '/searchform.php'); ?>
</div>
Thanks Andrea.. Gain... You're a life saver. Did you ever manage to talk to Ron..?
Still.. I have it working, but that side bar is still dynamic, i.e. they can still add widgets. I don't want them to be able to add widgets to that one side bar. I have the search and the Google ads running there, and that should be all.
Which part do I alter then?
Thanks.
lunabyte
Member
Posted 18 years ago #
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar(2) ) : else : ?>
<?php endif; ?>
Or whatever it is in that particular sidebar, just take it out.
Perfect.. That is it..! Thanks.
Doh, yeah luna's correct as usual. ;) I was speedreading thru the original post.
I wonder, don't you need to change the admin functions of the theme as well and remove the sidebar registration code, in order to not confuse the users with a mysterious side bar which can be configured but is never being displayed?
so am i still incorrect?. i thought i said the same thing he did. my bad, i forgot to mention deleting the '<?php endif; ?>'. thats what the whole 'unexpected' line was about