Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Denis Zhidkov
Denis Zhidkov
2,660 Points

Wordpress header links

Header links works well from the home page (http://pomatti.com/), however once I moved to one of the pages all links are broken. For example: Once I moved to About page (http://pomatti.com/about/) all of the link in the header will look like this http://pomatti.com/about/...

How can i fix it?

<header>
    <div class="headerRow">
        <div class="logoRow">
            <a class="logo" href="#"></a>
        </div>
        <div class="menu">
            <a class="headerMenu" href="about">О нас</a>
            <a class="headerMenu" href="products">Каталог</a>
            <a class="headerMenu" href="delivery">Оплата и доставка</a>
            <a class="headerMenu" href="news">Новости</a>
            <a class="headerMenu" href="contacts">Контакты</a>
        </div>
    </div>
</header>

1 Answer

jag
jag
18,266 Points
<header>
    <div class="headerRow">
        <div class="logoRow">
            <a class="logo" href="#"></a>
        </div>
        <div class="menu">
            <a class="headerMenu" href="/about">О нас</a>
            <a class="headerMenu" href="/products">Каталог</a>
            <a class="headerMenu" href="/delivery">Оплата и доставка</a>
            <a class="headerMenu" href="/news">Новости</a>
            <a class="headerMenu" href="/contacts">Контакты</a>
        </div>
    </div>
</header>

With the / it tell the links that it will be relative to the main page rather than the about page.