About the Author

Michael D. Pollock is the CEO of Solostream Web Studio. He's a geek-at-heart and a small business veteran with over 12 years of in-the-trenches sales, marketing and entrepreneurial experience (he mistakenly thinks he may soon have it all figured out). You can contact Michael via email here or online here.

Is there any way I can make the BlogRoll links just appear on the first page?

Becky Asks: Is there any way I can make the BlogRoll links just appear on the first page?

Answer: If you are using the default Links widget, there’s no way to make the links appear only on the first page.

What you can do is this, however:

1. Click on the “Presentation” link on your Wordpress navigation bar.
2. Then click on “Theme Editor” on your sub-navigation bar.
3. Then click on the “functions.php” template form the list of theme files on the right.

You’ll see a block of code like this:

<?php
if ( function_exists('register_sidebar') )
    register_sidebars(2);
?>

Just after the line that says register_sidebars(2), insert a line break, and add the following code (be sure to leave the ?>:

function widget_mybookmarks() {
?>
  <?php if (is_home()) { ?>
    <?php wp_list_bookmarks(); ?>
  <?php } ?>
<?php
}
if ( function_exists('register_sidebar_widget') )
    register_sidebar_widget(__('My Bookmarks'), 'widget_mybookmarks');

Then click the Update File button.

This will create a new widget on your Available Widgets panel called My Bookmarks. Just drag that into your sidebar, and remove the other Links widget.

4 Comment(s)

  1. On Nov 8, 2007, Michael Doig said:

    Will this make the thinner column go away on a single post page, or will it just remove the blogroll links? It would be great if only the index page had the thinner column and the single post page had a wider content area.

  2. On Nov 8, 2007, Michael Pollock said:

    Michael: This will only affect the blogroll links. It will not affect the middle sidebar.

    To remove the middle sidebar on the single post page:
    1. Open the Single Post template in your Theme Editor.
    2. Find <div id="content"> near the top, and delete it.
    3. Scroll to the bottom and find this block of code:

        </div>
     
    <?php include (TEMPLATEPATH . "/sidebar1.php"); ?>
     
      </div>
     
    <?php get_sidebar(); ?>

    Change it to just this:

      </div>
     
    <?php get_sidebar(); ?>

    Then click the Update File button.

  3. On Nov 9, 2007, Derrek Engeler said:

    Michael,
    A related question — how can I remove the middle sidebar when pages I create are selected? Is it a similar process to remove it in the page template? Also, will this allow me to make the pages wider by taking the space that was previously used by the middle sidebar?

    Thanks,
    Derrek

  4. On Nov 14, 2007, Becky said:

    Thanks for the mention. In the end I used:


    <?php if (is_home()) { wp_list_bookmarks(); } else { wp_list_bookmarks(’category=4′); } ?>
    <?php
    }
    if ( function_exists(’register_sidebar_widget’) )
    register_sidebar_widget(__(’MyLinks’), ‘widget_mytheme_mylinks’);
    ?>

    As I want the category 4 blog roll links (my affiliate links) to appear on every page ! ;)

    Thanks,
    B

Post a Comment