• Hi,
    I’ve created a theme following some online tutorial and I have some problems with it. My template is here: http://www.litl.michalweb.pl. The problem is that anchors placed in Sidebar don’t work on the post.
    In the post my anchors look like this:
    <a name="one" id="one">one</a>
    and then Im creating a Link that is places in the sidebar like this:
    http://litl.michalweb.pl/events#one
    And the weirdest thing ( at least for me) is that it works in Chrome and a bit in IE but it doesnt want to work in Safari and FF.
    Im also using some jQuery for jScrollPane and Portfolio Slideshow.

    I think that I made a mistake in my sidebar.php, because when I put anchors outside of this:

    <?php
    if ( ! dynamic_sidebar( 'primary-widget-area' ) ) : ?>
    	<?php wp_list_bookmarks( 'show_description=1&limit=4&between=<br />'); ?>
    <?php endif;  ?>

    then it works.
    I tried to look for the solution on the forum, google it or even placed similar question on stackoverflow bot nothing helped. Right now I have no idea what is wrong and Im not even sure which part of the code is responsible for my problem. If someone would be interested in helping me then I can put more code. I simply didnt know which part of the code might cause problems.
    Thanks a lot.
    Michal

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Kathryn Presner

    (@zoonini)

    In the post my anchors look like this:
    one

    I don’t actually see this in your code, I see this:

    <p>one<br />
    <a name= "one" >&nbsp;</a></p>
    
    <p><a  name= "two" >&nbsp;</a></p>
    
    <p><a  name="three">&nbsp;</a></p>

    I think you need the id="one" (etc.) part to get it to work across browsers.

    Moderator Kathryn Presner

    (@zoonini)

    p.s. I’m not sure why you’re putting the anchor on an <a> tag around a non-breaking space, is there some reason for that?

    Try instead a heading tag like <h2> and style it to get it looking how you want it.

    <h2 id="one">Your heading for the first section</h2>

    Thread Starter michal09

    (@michal09)

    Hi,
    Thanks for your help zoonini.
    The reason for putting my anchors on an <a> tag around non-breaking space is because I found this solution online and decide to try it out. Before that I tried to use id, name or both of them. Thats what Im using now and it does not work. It looks like Safari sees my anchors for a second and then dont care about it.
    I tried to use <a></a>, <span> or < h2> tags as well but it didnt help.
    ;/

    Moderator Kathryn Presner

    (@zoonini)

    I suggest looking at why your anchor links are getting a slash added where there shouldn’t be one.

    Example, your link:

    http://litl.michalweb.pl/events#one

    …when clicked, redirects to:

    http://litl.michalweb.pl/events/#one

    Note the slash before the #. That may be causing the issue.

    Moderator Kathryn Presner

    (@zoonini)

    Actually – ignore my previous post. I forgot you’re not using regular anchor links but combining it with a script. I’m going to have to let someone else chime in as this is outside my area of expertise. Good luck!

    Thread Starter michal09

    (@michal09)

    Well.. thanks anyway 🙂 Maybe someone else will be up for this challange 😉

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘problem with anchors in custom theme’ is closed to new replies.