[resolved] Custom menu add anchor tags (6 posts)

  1. Karan.thakural89
    Posted 1 year ago #

    Hi All,

    I'm very new in wordpress.I've a custom menu in left side bar on Page A. If i click on any item in custom menu in page A, it should take me to that text in Page A.

    How to do this. Do i need to use links in Appearance->Menus.

    Please guide me how to do this.


  2. rdellconsulting
    Posted 1 year ago #

    Without going into a full HTML solution, let me try to help with some shortened pseudo-code that should help you.

    The Page will contain something along the lines of:

    <div class="paragraph" id="one">
    <h1>Heading One</h1>
    [some HTML]
    <div class="paragraph" id="two">
    <h1>Heading Two</h1>
    [some HTML]

    You'll use some CSS to style it using

    .paragraph #one {[css here];}
    .paragraph #two {[css here];}

    Then as you say, you'll setup Dashboard>Appearance>Menus items using the Links items with a URL of #one, #two etc.

  3. Karan.thakural89
    Posted 1 year ago #

    I tried what u said.

    First of all, i gave id to the text. Then, i went into App->menus->link..
    and i gave href="#id"

    It is working, but, it is taking me to the content of that text. For example, Text is Computers and the content of Computers is A machine or device.

    So, it is taking directly to me machine or device. In that case, what is happening, computers is being hidden, as it is in middle of the page.

    What i need is it should point me to Computers only not the content.

    Please help me on this.

  4. Karan.thakural89
    Posted 1 year ago #

    Sorry, page was not properly loaded. It is working fine.

    I haven't used CSS in this, Could you explain me the role of CSS in this?

  5. rdellconsulting
    Posted 1 year ago #

    Only needed if you want to style the anchor. eg when you :hover, you might change the color and/or add some shading or underlining

  6. Karan.thakural89
    Posted 1 year ago #


Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic