Home Forums Basel support forum Changing labels on header links

Changing labels on header links

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #7535

    MilanBatinic
    Participant

    Hi!

    I have breadcrumb with label “Hem” on product pages which is how i want it to be.
    On my-account page (only page on website with “Page title” option enabled) breadcrumb label is “Home”. Any idea on how to fix that?

    One more question, I need to change labels on header links (Log in/Register, My Account/Log out).
    I have tried to put this peace of code into my child themes functions and it worked except for the “Log out” label was missing when user is logged in. How can I fix this?

    function basel_get_header_links() {
    $links = array();

    if( ! basel_woocommerce_installed() ) return $links;

    $account_link = get_permalink( get_option(‘woocommerce_myaccount_page_id’) );

    if( basel_get_opt( ‘login_links’ ) ) {
    if( is_user_logged_in() ) {
    $links[] = array(
    ‘label’ => esc_html__(‘Mitt konto’, ‘basel’),
    ‘url’ => $account_link
    );
    } else {
    $links[] = array(
    ‘label’ => esc_html__(‘Logga in / Registrera’, ‘basel’),
    ‘url’ => $account_link
    );
    }
    }

    return apply_filters( ‘basel_get_header_links’, $links );
    }

    #7537

    Artem Temos
    Keymaster

    Hello,

    Thank you so much purchasing our theme and contacting our support center.

    We suggest you to edit/translate all strings on the site including Login, Logout, My Account, Home with POT files using Loco Translate Plugins. Here is a video tutorial that should help you https://www.youtube.com/watch?v=tAFq1yTfWfU&t=1s

    Kind Regards
    XTemos Studio

    #7554

    MilanBatinic
    Participant

    Thank you for answering in such short notice.
    Loco was helpful but it left me with some of the work undone.
    Translation did not work on Log in / Register label and it has not changed “Home” label in breadcrumb on “my-account” page.

    #7555

    Artem Temos
    Keymaster

    Hi,

    We see that “Home” word was not translated at all. The only one problem now is “Login / Register”. Could you send us your FTP access so we could check it? Or we will send you a workaround how you can translate it manually with PHP files.

    Regards

    #7556

    MilanBatinic
    Participant

    Hi,
    please send a workaround, i would like to learn myself how this problem can be solved.

    Kind regards
    Milan

    #7557

    Artem Temos
    Keymaster

    Hi,

    Try to override this function in your child theme functions.php file and change text in the source code. So simply put this code to your functions.php file in the child theme and edit “Login / Register” text

    function basel_get_header_links() {
    	$links = array();
    
    	if( ! basel_woocommerce_installed() ) return $links;
    
    	$account_link = get_permalink( get_option('woocommerce_myaccount_page_id') );
    	$logout_link = wc_get_endpoint_url( 'customer-logout', '', wc_get_page_permalink( 'myaccount' ) );
    
    	if( basel_get_opt( 'login_links' ) ) {
    		if( is_user_logged_in() ) {
    			$links[] = array(
    				'label' => esc_html__('My Account', 'basel'),
    				'url' => $account_link
    			);
    			$links[] = array(
    				'label' => esc_html__('Logout', 'basel'),
    				'url' => $logout_link
    			);
    		} else {
    			$links[] = array(
    				'label' => esc_html__('Login / Register', 'basel'),
    				'url' => $account_link
    			);
    		}
    	}
    
    	return apply_filters( 'basel_get_header_links',  $links );
    }

    Regards

    #7600

    MilanBatinic
    Participant

    Hi!
    I am not sure if i’m doing something wrong. I did copy/paste of the code you’ve sent and the website went down reporting an error on one of the lines. I really need to change these labels so I am sending you FTP log in details so you can try to fix yourselves. Please try not to crash my website 🙂

    Kind regards
    Milan

    #7604

    Artem Temos
    Keymaster

    Hi,

    Ok, we have added the code and now you are able to edit these texts in basel-child/functions.php file.

    Regards

    #7611

    MilanBatinic
    Participant

    Hi and thanks a lot guys!

    Your response was really fast and helpful. You are going to get the best grade from me.
    I have one more question which is off topic. How do I upgrade “WPBakery Visual Composer” plugin which came with theme?

    #7614

    Artem Temos
    Keymaster

    Hello,

    If you have the latest theme version installed then you can update Visual Composer plugin from Appearance -> Install plugins.

    Regards

    #7615

    MilanBatinic
    Participant

    Hi,
    i have themes latest version but Visual Composer does not appear in Appearance -> Install plugins.
    Should I uninstall it first?

    Regards,
    Milan

    #7617

    Artem Temos
    Keymaster

    In this case, you are running the latest version of Visual Composer available with our theme. If a new one is already released we will add it in our next theme update.

    Regards

    #7621

    MilanBatinic
    Participant

    Hi,
    thanks for info and again a big thank you for helping me to make changes on labels.

    Best wishes!
    Milan

    #7627

    Artem Temos
    Keymaster

    Hi,

    We are happy to help you 🙂

    Regards

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