Tag Archives: sidebar

WordPress: Exclude Category from Front Page – Still Show in Sidebar?

WordpressThis method will allow you to have a category “ONLY” appearing in your sidebar but excludes posts from the front page

1- Added this code to “index.php
(Notes: category # says -20, this # is the category I dont want on the front)
(also this needs to appear in your code before the loop)

(my excluded Category was 20, for more than one category use: -3,-20 (separate your categories with commas!)

2- Add the following code to your “index.php” file, but before the Loop

<?php query_posts($query_string . ‘&cat=-20’); ?>

This code will now exclude that category #20 from your home page posts BUT can be used to show up in one of yoru side bar plugins Continue reading WordPress: Exclude Category from Front Page – Still Show in Sidebar?

WordPress: How to add a “Grab My Code” button area to Sidebar?

This has often been a question asked especially in regards to WordPress Blogs. I found this great site, that takes care of the whole coding process for you. Once complete paste this code into one of your “text” widgets in your sidebar

http://www.mycoolrealm.com/sandbox/gbgen/

Example code used for client http://mommasays.net/  (below)
The code I generated has been listed below (in case the site listed above is no longer active)

<div align=”center” style=”padding: 5px;”><img src=”http://mommasays.net/images/mommasays-button.png”  title=”MommaSays.net” alt=”MommaSays.net” /></div><textarea style=”background:#f0f0f0;border:solid 1px #999999; color: #777777; font-size: 90%; height:45px; margin:auto; text-align: left; padding: 2px 0 2px 5px; display: block;  width: 90%;”>&lt;div align=&quot;center&quot;>&lt;a href=&quot;http://mommasays.net&quot; title=&quot;MommaSays.net&quot; target=”_blank”&gt;&lt;img src=&quot;http://mommasays.net/images/mommasays-button.png&quot; alt=&quot;MommaSays.net&quot; style=&quot;border:none;&quot; /&gt;&lt;/a&gt;&lt;/div></textarea> Continue reading WordPress: How to add a “Grab My Code” button area to Sidebar?