Home Forums Basel support forum Create label

Create label

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #24686

    coutm
    Participant

    Hi,

    I would like to know if I can create a own label for the menu (see the attachment). You create HOT, SALE and NEW, but I would like to add some new label. And if I can, I would like to know how I do?

    Thank you!

    Attachments:
    You must be logged in to view attached files.
    #24688

    coutm
    Participant

    For this moment, you see «cool» in my label field because I change Hot for Cool with WPML. But I really want to create a lot of label.

    #24707

    Artem Temos
    Keymaster

    Hi,

    Unfortunately, there are no additional labels options in our theme. You can do this only with additional customization.

    1. Firstly, you need to add an option in the file inc / third-party / nav-menu-images / inc / walker.php

    find this code

    <option value="hot" <?php selected( $label, 'hot', true); ?>><?php _e('Hot', 'basel'); ?></option>
    <option value="sale" <?php selected( $label, 'sale', true); ?>><?php _e('Sale', 'basel'); ?></option>
    <option value="new" <?php selected( $label, 'new', true); ?>><?php _e('New', 'basel'); ?></option>

    and add more options like this

    <option value="hot" <?php selected( $label, 'hot', true); ?>><?php _e('Hot', 'basel'); ?></option>
    <option value="sale" <?php selected( $label, 'sale', true); ?>><?php _e('Sale', 'basel'); ?></option>
    <option value="new" <?php selected( $label, 'new', true); ?>><?php _e('New', 'basel'); ?></option>
    <option value="custom" <?php selected( $label, 'custom', true); ?>><?php _e('Custom', 'basel'); ?></option>

    then, edit this file inc / functions.php

    switch ( $label ) {
    	case 'hot':
    		$label_text = esc_html__('Hot', 'basel');
    	break;
    	case 'sale':
    		$label_text = esc_html__('Sale', 'basel');
    	break;
    	case 'new':
    		$label_text = esc_html__('New', 'basel');
    	break;
    }

    Replace with this

    switch ( $label ) {
    	case 'hot':
    		$label_text = esc_html__('Hot', 'basel');
    	break;
    	case 'sale':
    		$label_text = esc_html__('Sale', 'basel');
    	break;
    	case 'new':
    		$label_text = esc_html__('New', 'basel');
    	break;
    	case 'custom':
    		$label_text = esc_html__('Custom', 'basel');
    	break;
    }

    Regards

Tagged: 

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