WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Modify Side bar (10 posts)

  1. factor1studios
    Member
    Posted 8 years ago #

    My current theme (back in black2) calls the side bar into the heard. I want to change the links (like home, archives, categories, links, pages, meta & search) to other things. I can flat out remove them no prob. but I just want to plug in some other links.

    here is the site:
    http://nateendicott.com/index.php

    any thoughts?

  2. factor1studios
    Member
    Posted 8 years ago #

    this is my sidebar code. I cant find a link to modify at all.

    <!-- begin sidebar -->
    <div id="menu">
    <span id="menu_tab_posts" class="menu" style="; background-color: #000; border-left: #000 1px solid;" onmouseover="overTab('menu_tab_posts');" onmouseout="outTab('menu_tab_posts');" onclick="switchTab('tab_posts');"> home </span>

    <span id="menu_tab_archives" class="menu" onmouseover="overTab('menu_tab_archives');" onmouseout="outTab('menu_tab_archives');" onclick="switchTab('tab_archives');"> archives </span>

    <span id="menu_tab_categories" class="menu" onmouseover="overTab('menu_tab_categories');" onmouseout="outTab('menu_tab_categories');" onclick="switchTab('tab_categories');"> categories</span>

    <span id='menu_tab_links' class="menu" onmouseover="overTab('menu_tab_links');" onmouseout="outTab('menu_tab_links');" onclick="switchTab('tab_links');"> links </span>

    <span id='menu_tab_pages' class="menu" onmouseover="overTab('menu_tab_pages');" onmouseout="outTab('menu_tab_pages');" onclick="switchTab('tab_pages');">pages</span>

    <span id='menu_tab_meta' class="menu" onmouseover="overTab('menu_tab_meta');" onmouseout="outTab('menu_tab_meta');" onclick="switchTab('tab_meta');"> meta </span>

    <span id='menu_tab_search' class="menu" onmouseover="overTab('menu_tab_search');" onmouseout="outTab('menu_tab_search');" onclick="switchSearch('tab_search');"> search </span>

    <div id="tab_search" style="display: none; padding-top: 3px;"><form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="s" id="s" size="15" /> <input type="image" src="/wp-content/themes/back_in_black_2/img/search.png" name="submit" /></form></div>
    </div>
    <!-- end sidebar -->

  3. spencerp
    Member
    Posted 8 years ago #

    Please don't post long codes in here, use http://www.pastebin.com next time please. =) I did it up for you this time. =)

    http://pastebin.com/616864

    All you do is put your code into that window for whatever code you have, and then type your name in the little window for it and click submit, done.. and grab that url for it..once it refreshes page..

    spencerp

  4. factor1studios
    Member
    Posted 8 years ago #

    any idea how to change these links?

  5. Bodhipaksa
    Member
    Posted 8 years ago #

    You need to open sidebar.php and edit that. It'll be in whichever theme folder you're using. The code above isn't the place to start.

  6. factor1studios
    Member
    Posted 8 years ago #

    that code above, is the code from sidebar.php, in my theme. thats why I cant figure out what is going on.

  7. moshu
    Member
    Posted 8 years ago #

    Quite an idiotic way to name it "sidebar" when it is a horizontal menu :)
    It's a javascript based menu (the JS is there is the "head") and you either re-write it to show your links - or whatever you want there; or just delete it.

  8. factor1studios
    Member
    Posted 8 years ago #

    I agree. The Header.php is calling the sidebar.php. It isnt my theme, Im just tearing into it.

    Here is the code for the header, http://pastebin.com/617296

    I still dont see where it is directing the links.

  9. marke1
    Member
    Posted 8 years ago #

    The template uses divs and javascript to display a "tab" when a user clicks. If you look at the source of the main index you see stuff like this:

    <div id='tab_categories' style="display: none;">

    That's the beginning HTML tag of the section that shows up when someone clicks on categories. Notice the "display: none" part. That tells the browser not to show it, but it IS in there. So when a user clicks a tab then the javascript changes the display property to "block" :

    document.getElementById(aTab).style.display = "block";

    So, to change the links, change the div areas. Here's a basic example:

    Add a new line in your sidebar file:


    <span id="menu_tab_my_new_link" class="menu" onmouseover="overTab('menu_tab_my_new_link');" onmouseout="outTab('menu_tab_my_new_link');" onclick="switchTab('tab_my_link_link');"> New </span>

    Then, insert a new section in the index page HTML:


    <div id='tab_my_new_link' style="display: none;">
    Blah blah blah. New stuff...
    </div>

    That outta do it -- I didn't test it though. I'm just wingin' it since I'm not proficient in javascript. But I can hack ;-)

  10. factor1studios
    Member
    Posted 8 years ago #

    Perfect. thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.