Widget Logic in Your Sidebar

Widget Logic is a great plugin that uses the  Wordpress conditional code to insert widgets on selected pages in your site. If you are adding contact information for a business or school and only want to have the information appear on selected pages, this is the answer.

You can hard code the information in your templates but this is sooo much easier.

Upload Widget Logic to your plugin folder and activate.

You need to have the page number of the page you want this widget to appear.page_number

Finding the page number:

Click the “Pages” link in your menu.

The pages in your site appear in the dashboard window.

Scroll over the page name with your mouse and look at the bottom of your computer screen. The page number appears in the text at the bottom of the screen. It looks like this: http://www.mcqwebsolutions.com/wp-admin/page.php?action=edit&post=11  Page number is 11.

Click on widgets under the Appearance tab in your menu.

Select the widget you want to add to your sidebar.  Select a text widget if you want to add contact information and add it to the selected sidebar.  Click “edit” to open the text widget and add your information.

widgetlogicAt the bottom of the text widget, you will see the area to add the widget logic code.  This is where you will add the page number where you want the widget to appear. If you didn’t find the page number, follow the instructions above.

Enter the code in the box. For one page it looks like this:

Is_page(x) where x is the page the widget appears. If you want the widget to appear on mulitiple pages, use pipes between the page numbers.

it looks like this:

is_page(22||23)

Save your changes and your work is finished!

Speak Your Mind

Tell us what you're thinking...