How can i change account redirection on Header ?

This topic has 7 replies, 2 voices, and was last updated 2 years, 6 months ago ago by moodi2727

  • 6 Answers
    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 19, 2022 at 07:19

    Hello,

    Thanks for using our theme.
    Do you mean you want to change the link of this icon in the header – https://prnt.sc/JiL0obNht0WI or links of this menu https://prnt.sc/R2s9k7Y_sgJh ?

    Regards

    Avatar: moodi2727
    moodi2727
    Participant
    June 19, 2022 at 20:40

    yes dears, i want to change the link of this icon in the header

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 20, 2022 at 13:05

    Hello

    Would you like to have next result https://prnt.sc/xMvWLogJSgWT ?
    If so then you may add next code to your child-theme/functions.php
    or you may install any Code Snippets plugin and add the code to their php code areas.

    Code:

    add_filter('header_account_link', function($url) {
    return get_dashboard_url();
    });

    Backend: https://prnt.sc/AsSFjFmRbeOG

    If you would like to have another result, please, provide us more details with screenshots or example urls for logged In and unlogged In users.

    Regards

    Avatar: moodi2727
    moodi2727
    Participant
    June 21, 2022 at 00:12

    hello there

    thank you so much … code works fine and redirected to wordpress dashboard.

    but i need it to be redirected to courses dashboard 🙂

    here the URL for the courses dashboard :

    https://tomoo7.com/dashboard/

    courses dashboard

    Avatar: Rose Tyler
    Rose Tyler
    Support staff
    June 21, 2022 at 08:25

    Hello,

    if you want to hardcode redirect to another url different from your origin web-site then you may use next snippet

    add_filter('header_account_link', function($url) {
    return "https://tomoo7.com/dashboard/";
    });

    Otherwise if you want to redirect to ‘dashboard’ but on your web-site then

    add_filter('header_account_link', function($url) {
    return home_url('/dashboard/');
    });

    WordPress documentation: https://developer.wordpress.org/reference/functions/home_url/

    Regards

    Avatar: moodi2727
    moodi2727
    Participant
    June 22, 2022 at 11:28

    Thank You So Much … it works fine

    Regards

  • Viewing 7 results - 1 through 7 (of 7 total)

The issue related to '‘how can i change account redirection on Header ?’' has been successfully resolved, and the topic is now closed for further responses

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.