Hi, I've read that displaying a Blogroll on every page of my site can hurt my page rank. This is from the effect of having too many outbound links that aren't necessarily relevant on each page of my site. People have claimed that this single modification helped preserve their page rank or stopped PR bleeding. So, I'd like to learn how to display my Blogroll widget only on my homepage and none of the other pages. I'm not a PHP whiz, so I'd appreciate a simple explanation or just before and after code snapshots and which PHP files are involved if possible. Many Thanks George
Yeah, word press doesn't give enough options. There should be options to just show certain widgets on certain pages. Hope you get an answer here. I want to know it too.
<?php if (is_home() { } ?> PHP: Put your blog roll call in between the { and }. For other pages, just specify the slug you want. For example, on one of my sites, I will be using a custom menu that looks like this: <ul id="menu"> <li><a <?php if (is_page('home')) { ?> class="current-page" <?php } ?> href="/" title="Go to (site name)’s Home Page">Home</a></li> <li><a <?php if (is_page('about')) { ?> class="current-page" <?php } ?> href="/about/" title="About (site name)">About Us</a></li> <li><a <?php if (is_page('services')) { ?> class="current-page" <?php } ?> href="/services/" title="Why You Should Hire Us">Services</a></li> <li><a <?php if (is_home() || is_single() ) { ?> class="current-page" <?php } ?> href="/writing/" title="(Site Name)’s Articles">Blog</a></li> <li><a <?php if (is_page('contact')) { ?> class="current-page" <?php } ?> href="/contact/" title="Have a Question? Send Us a Message">Contact</a></li> </ul> PHP:
Check in your theme editor->sidebar, search for the blogroll code! add before: <?php if(is_home()): ?> and after <?php endif; ?> example <?php if(is_home()): ?> <li id="links"> <h2>Blogroll</h2> <ul> </ul> </li> <?php endif; ?> Code (markup): It should work...
could anyone give any code for my blog?I am using blogger. So for that is it possible to show blog roll for homepage only?
Sorry, I don't use Blogger, otherwise I probably would be able to. Have you tried searching on Google by any chance?
The above folks have already given you the code, but yet the blogroll will be displayed in the secondary pages to keep it just to the homepage and nowhere else you can use this code <?php if (is_home() && (!$paged || $paged == 1)) { ?> Your blogroll code here <?php } ?> Code (markup):
If this is true than SE is being harsh, a blogroll can be just like or act as your nav menu which obviously needs to be displayed on every page?
Gah. Why would you go mucking around in the template files to build a sidebar? Wordpress introduced widgetized sidebars for a reason. You can change your theme to include more than one widgetized sidebars (I use three diff. ones). Here's some documentation on creating widgetized sidebars. Invest a little time up front, and sidebar management will be much easier. - Walkere
That's what wp_list_pages() is for, actually. Because sometimes you need to do things that a widget cannot simply do. Oh, and some of us (especially minimal markup experts such as myself) like having total control over the code we use. Something else that you cannot do with widgets. I can't speak for Mircea, but you're welcome.