• Resolved josh1983

    (@josh1983)


    Alright I have been searching the web for the last couple of hours trying to figure out how to do this and nothing is making much sense to me.

    here is my situation I have the following

    <div class="sidebar-nav">
    
    <ul>
    <li><a href="category/print-work"> PRINT WORK </a> </li>
    <li><a href="category/web-work"> WEB WORK</a> </li>
    </ul>
                       </div>

    so when someone clicks on print work it goes to category/print-work wow thats no suprise there buttttttttttt what the issues is, for some reason when someone clicks on print work my url now becomes

    http://www.yoursite.com/category/print-work/category/web-work

    and then if I were to click back to print it does the same thing

    http://www.yoursite.com/category/print-work/category/web-work/category/print-work

    so it just keeps adding on to the url. I have been trying a whole bunch of things with no success
    please someone helpppppp

    ~Josh

Viewing 5 replies - 1 through 5 (of 5 total)
  • Anonymous User

    (@anonymized-473288)

    How are you writing the link in your template file?

    Thread Starter josh1983

    (@josh1983)

    the link to the template file?? I guess I dont follow what you mean?

    Read (=google) about the difference between relative and absolute path.
    Use absolute.

    Thread Starter josh1983

    (@josh1983)

    but why should I use absolute that seems kind of backasswords in relation to proper coding methods I mean doing “www.yoursite.com/category/blog”
    seems a bit I don’t know not standard anymore I could do that to solve the problem but I have been reading about the htaccess stuff and was wondering if there was a way to avoid absolute paths

    Anonymous User

    (@anonymized-473288)

    @josh1983

    the link to the template file?? I guess I dont follow what you mean?

    Yesterday when I read the post I just saw some links instead of the code that is shown now. That’s why I asked. 🙂 Did you correct the post by any change, otherwise it was a browser glitch?

    When I look at the code I see you don’t have the “/” before the first letter in the link. Can you please see if the code below will work.:

    <div class="sidebar-nav">
    
    <ul>
    <li><a href="/category/print-work">PRINT WORK</a></li>
    <li><a href="/category/web-work">WEB WORK</a></li>
    </ul>
                       </div>

    As far as I remember linking without the “/” just tacks on the link to the existing url, instead of the domain url. Unfortunately I don’t have a test setup where I could test it for you, to be sure.

    In any case you can also use the following in WordPress:

    <a href="<?php echo get_option('home'); ?>/your-page-name">

    This keeps your links the same even if you move the theme (template file) to another domain, etc.

    Edit: Ah, placing code in the blockquote tag instead of the backticks causes the link html code to change to normal links. Just had this happen myself.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘rewrite help PLEASE someone’ is closed to new replies.