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.
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.
At 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!
Adding Information in your Sidebar
The sidebar appears on every page of your Wordpress site. Usually the themes have default widgets that appear in the sidebar. Once you add a new widget, t he default configuration changes. For example, if you drag a text widget into your sidebar, that is the only widget that will appear – the original default widgets that came with your theme are gone.
The text widgets are great for adding contact information, graphics and ads to your sidebars. You have to add the html code for links but I will show you how.
Open the widgets under the Appearance tab in the menu. Drag a text widget into your sidebar. Click the edit button to open the text box. Add a title to your text widget if you want – this is what will appear as a header or title in your sidebar.
Add your contact information. Use html to add links and images. Here is an example of code used to add a link to the sidebar. Copy it and add your own information. Note – if you are unable to copy and paste items in the text widget using Internet Explorer – use Firefox. Firefox makes it a lot easier to copy and paste in widgets.
For More Information on Creating a Wordpress Site, <a href=”mailto:info@mcqwebsolutions.com”>Contact Us</a> at <a href=”http://www.mcqwebsolutions.com”>
McQWebsolutions.com</a>
Once you have your content entered, scroll to the bottom of the screen and select the sidebar position where you want the
content to appear and select the option to automatically add paragraphs.
Note: You can control the spacing of your content in the sidebar by using the <br /> tag. Use the break tag to push content to a new line without adding a large space between the lines like a paragraph tag might add.
This text widget will appear on ALL the pages in your site unless you use a “conditional” statement to tell Wordpress where you want it to appear. An easier way is to use the Widget Logic plugin. This is a plugin that makes it easy to use Wordpress as a content management system – I listed it as one of the best plugins in an earlier post. I will talk about Widget Logic next, so stay tuned.





