How Do I Restrict BlogRoll to My Homepage Only?

Discussion in 'Search Engine Optimization' started by gmr324, Feb 6, 2008.

  1. #1
    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
     
    gmr324, Feb 6, 2008 IP
  2. JWRmedia

    JWRmedia Banned

    Messages:
    499
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What are you running? Wordpress?
     
    JWRmedia, Feb 6, 2008 IP
  3. astup1didiot

    astup1didiot Notable Member

    Messages:
    5,926
    Likes Received:
    270
    Best Answers:
    0
    Trophy Points:
    280
    #3
    First, we need to know the blog platform that you are running to answer the question correctly.
     
    astup1didiot, Feb 6, 2008 IP
  4. gmr324

    gmr324 Active Member

    Messages:
    205
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #4
    Thanks for the reply. Yes, I am running Wordpress.

    Thanks

    George
     
    gmr324, Feb 7, 2008 IP
  5. gtull1

    gtull1 Guest

    Messages:
    619
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    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.
     
    gtull1, Feb 7, 2008 IP
  6. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #6
    <?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)&#8217;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)&#8217;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:
     
    Dan Schulz, Feb 7, 2008 IP
  7. xxMirceaxx

    xxMirceaxx Well-Known Member

    Messages:
    917
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    135
    #7
    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...
     
    xxMirceaxx, Feb 7, 2008 IP
  8. clipod

    clipod Peon

    Messages:
    189
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #8
    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?
     
    clipod, Feb 7, 2008 IP
  9. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Sorry, I don't use Blogger, otherwise I probably would be able to. Have you tried searching on Google by any chance?
     
    Dan Schulz, Feb 7, 2008 IP
  10. gtull1

    gtull1 Guest

    Messages:
    619
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Thanks Dan and Mircea.
     
    gtull1, Feb 7, 2008 IP
  11. Trapped

    Trapped Well-Known Member

    Messages:
    1,832
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    130
    #11
    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):
     
    Trapped, Feb 7, 2008 IP
  12. kiddie30

    kiddie30 Peon

    Messages:
    527
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #12
    thanks will try on my blog..thanksss.
     
    kiddie30, Feb 7, 2008 IP
  13. bogart

    bogart Notable Member

    Messages:
    10,911
    Likes Received:
    509
    Best Answers:
    0
    Trophy Points:
    235
    #13
    Good idea. I'll try this out.
     
    bogart, Feb 9, 2008 IP
  14. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #14
    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?
     
    wd_2k6, Feb 9, 2008 IP
  15. walkere

    walkere Active Member

    Messages:
    112
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #15
    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
     
    walkere, Feb 9, 2008 IP
  16. safe6

    safe6 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    Thanks Dan and Mircea.
     
    safe6, Feb 9, 2008 IP
  17. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #17
    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. :)
     
    Dan Schulz, Feb 9, 2008 IP