WordPress.org

Forums

Links in sidebar without using widget (6 posts)

  1. darone
    Member
    Posted 6 years ago #

    This is the code for my sidebar and I notice it's missing the link section. I tried to add the links via my widgets, but then all of the sidebar info that's there disappears! How do I just code it in? Is that possible?

    <div id="contentright">
         <?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar()):else: ?>
          <h1 class="sidebartitlepos">
            <?php _e('Search'); ?>
          </h1>
          <?php include(TEMPLATEPATH.'/searchform.php'); ?>
          <h1 class="sidebartitlepos">
            <?php _e('Calendar'); ?>
          </h1>
          <?php get_calendar(); ?>
          <h1 class="sidebartitlepos">
            <?php _e('Pages'); ?>
          </h1>
          <ul>
            <?php wp_list_pages('title_li=0'); ?>
          </ul>
          <h1 class="sidebartitlepos">
            <?php _e('Categories'); ?>
          </h1>
          <ul>
            <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0' ); ?>
          </ul>
          <h1 class="sidebartitlepos">
            <?php _e('Archives'); ?>
          </h1>
          <ul>
            <?php wp_get_archives('type=monthly'); ?>
          </ul>
          <h1 class="sidebartitlepos">
            <?php _e('Meta'); ?>
          </h1>
          <ul>
            <?php wp_register(); ?>
            <li>
              <?php wp_loginout(); ?>
            </li>
            <?php wp_meta(); ?>
            <?php endif; ?>
          </ul>
        </div>
        <!-- end #contentright -->
    <div class="clear"></div>
  2. equaldesign
    Member
    Posted 6 years ago #

    This code should work:

    <h1>Links</h1>
    <ul>
    <?php list_bookmarks(); ?>
    </ul>
  3. darone
    Member
    Posted 6 years ago #

    That didn't work right. All it did was make a new header that said "Links" and then there was nothing below it, not even my other sidebar items.

    I'm not a code person, so I'm learning as I go. Any help is appreciated. Thanks in advance!

  4. equaldesign
    Member
    Posted 6 years ago #

    sorry the code i copied is wrong. Should be:

    <h1>Links</h1>
    <ul>
    <?php wp_list_bookmarks(); ?>
    </ul>

    Been a long day!

  5. darone
    Member
    Posted 6 years ago #

    Thank you! I used this:

    <h1 class="sidebartitlepos">
            <?php _e('Links'); ?>
          </h1>
    <ul>
    <?php wp_list_bookmarks(); ?>
    </ul>

    And it worked, but now under the header "Links" I have another indented subheading "Blogroll" and then the links below indented even further. How do I get rid of that subheading "Blogroll" and move the link to match up with the indentation of the other sidebar items above? Is that in another php file?

  6. darone
    Member
    Posted 6 years ago #

    Eh. I've looked everywhere and can't find the answer. I'm just going to change templates.

Topic Closed

This topic has been closed to new replies.

About this Topic