October 24, 201015 yr Hello friends, I just came across this threadof how to display ceratin widgets on specific pages and categories in wordpress but i am confused where should i put this conditional tags ( is_page('3') || is_page('49') || is_home() ) say if i want to display a widget only on index page?
October 30, 201015 yr let's say your index.php is used for your home pag , those if statements should be in sidebar for your widgets , and then again , you have to use the php code of your widget on your sidebar.php so it's not customizable from wp-admin , find that and add these in your side bar this wasy : <?php if (is_home())?> <?php include TEMPLATEPATH"./searchform.php"?> <?php elseif (is_page(3))?> <?php archive()?> <?php elseif (is_page(...))?> . . . so on , find correct codes and do it this way
October 30, 201015 yr let's say your index.php is used for your home pag , those if statements should be in sidebar for your widgets , and then again , you have to use the php code of your widget on your sidebar.php so it's not customizable from wp-admin , find that and add these in your side bar this wasy : <?php if (is_home())?> <?php include TEMPLATEPATH"./searchform.php"?> <?php elseif (is_page(3))?> <?php archive()?> <?php elseif (is_page(...))?> . . . so on , find correct codes and do it this way see your other post
October 30, 201015 yr you mean will this tutorial help me even more ? yep - we do it like that too ~ Originally they asked if a plugin was available
November 4, 201015 yr I personally use conditional tags , but Richard introduced a plugin in the other post which solves the issue
November 15, 201015 yr There are lots of wp plugins that lets you display widgets on certain pages only. One of them is http://konstruktors.com/blog/wordpress/1020-display-widgets-only-on-certain-pages/
Create an account or sign in to comment