Remove 'Edit Theme' Option from Admin Navbar.

Home Forums I need help Remove 'Edit Theme' Option from Admin Navbar.

This topic contains 3 replies, has 2 voices, and was last updated by  cliffordjwilliamsyahoocouk 1 hour, 55 minutes ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5135

    cliffordjwilliamsyahoocouk
    Participant

    Hi,

    How do I Remove ‘Edit Theme’ Option from Admin Navbar?

    Thanks

    #5189

    tg_support
    Keymaster

    Hello.

    It was asked before in the forum, but we had no reply from the user at https://themesgenerator.com/tg/forums/topic/how-do-i-remove-the-edit-theme-that-show-in-the-top/

    You need to remove/comment a few lines of code to achieve that.

    Do you have some PHP experience? If yes, we can help you in pointing to the right direction.

    Kind regards.

    #5373

    cliffordjwilliamsyahoocouk
    Participant

    Yes, I can edit PHP code.

    (I’ve just seen this. Is there a way I can be notified when you post an answer?)

    #5382

    cliffordjwilliamsyahoocouk
    Participant

    OK,

    based on the fact that you mentioned PHP, I went into ‘Theme Functions’ (functions.php), did a search (CTRL F) for ‘edit theme’ (without the quotes) and deleted the */ as indicated below.

    /*Edit in TG -DELETED THE */ FROM HERE-
    add_action(‘admin_bar_menu’, ‘add_toolbar_items’, 100);
    function add_toolbar_items($admin_bar){
    $external_link=get_template_directory_uri().”/themes-generator-theme.txt”;
    $complete_link=”https://themesgenerator.com/?editmode=ok&dedit=$external_link”;
    $admin_bar->add_menu( array(
    ‘id’ => ‘edit-theme’,
    ‘title’ => ‘Edit Theme’,
    ‘href’ => $complete_link,
    ‘meta’ => array(
    ‘title’ => __(‘Edit theme in Themes Generator’, ‘themesgenerator’),
    ‘target’ => __(‘_blank’, ‘themesgenerator’),
    ),
    ));
    }

    /**

    It appears to have worked.

    Is there anything else I need to do?

    Thanks

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.