WordPress.org

Ready to get started?Download WordPress

Forums

Custom Links in menu modification (9 posts)

  1. Senyaj
    Member
    Posted 1 year ago #

    Hello,

    In my custom theme, I have the option to add Custom Links into my navigation.

    I'd like to know how I can modify the "href" of each with a prefix, in my theme (without modifying the core wordpress).

    So for example if I create a custom link with the url as "John"

    It would output as this
    href="wordpress.org/john"

    Thanks

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Go to Appearances > Menus in the dashboard and create a custom menu there. You should then be able to specify the URLs.

  3. Senyaj
    Member
    Posted 1 year ago #

    Hello,

    Thank you for your response, I think you have misunderstood me.

    When I create a menu through my dashboard I want each to link have a prefix.

    So If I create a custom menu and specify "John" as the URL.

    On my navigation it will be displayed as:

    a href="wordpress.org/john">JOHN</a

    Instead of:

    a href="john">JOHN</a

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    The confusing part is using 'wordpress.org' as an example.
    What specifically do you want to have prefixed?

  5. Senyaj
    Member
    Posted 1 year ago #

    Hi,

    I thought that example would make it easier.

    Essentially, I would like the url to be href="#filter=.John"

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    What happens if you use the Custom Link URL as;

    /#filter=.John

    ?

  7. LastForOne
    Member
    Posted 1 year ago #

    just use #john in href instead of john because if you specify url=john it will take the root url of your blog (example.com) and add the john after a trailing slash (example.com/john)

    Peace,
    LastForOne

  8. Senyaj
    Member
    Posted 1 year ago #

    Hello,

    This is for a custom jQuery script.

    Thanks

  9. Senyaj
    Member
    Posted 1 year ago #

    Anyone know?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.