Special Offer: Buy All 48 Premium WordPress Themes for Just $74.99. Learn more

How to Change ‘Class’ and ‘Trainer’ names?

practices

In case you use some of our Pro themes which support ‘Classes’ and ‘Trainers’ as a custom types (such as tGymm, tKiddtSport, or tYoga), you may want to change the name ‘Class’ with something different i.e. ‘Practice’, or the ‘Trainer’ name. It will require a small code change. Here are all of the necessary steps:

  1. Login to your website Admin Panel
  2. Navigate to Left Menu -> Appearance -> Editor
  3. Open functions.php fileand rename the code marked in bold with other word:3.1. functions.php change the words marked in Bold:

    $labels = array(
    ‘name’ => __( ‘Classes‘, ’tishonator’ ),
    ‘singular_name’ => __( ‘Class‘, ’tishonator’ ),
    ‘add_new’ => __( ‘Add New’, ’tishonator’ ),
    ‘add_new_item’ => __( ‘Add New Class‘, ’tishonator’ ),
    ‘edit_item’ => __( ‘Edit Class‘, ’tishonator’ ),
    ‘new_item’ => __( ‘New Class‘, ’tishonator’ ),
    ‘view_item’ => __( ‘View Class‘, ’tishonator’ ),
    ‘search_items’ => __( ‘Search Classes‘, ’tishonator’ ),
    ‘not_found’ => __( ‘No Classes found’, ’tishonator’ ),
    ‘not_found_in_trash’ => __( ‘No Classes found in Trash’, ’tishonator’ ),
    ‘parent_item_colon’ => __( ‘Parent Class:’, ’tishonator’ ),
    ‘menu_name’ => __( ‘Classes’, ’tishonator’ ),
    );

    3.2. functions.php:

    add_meta_box( ‘class_metabox’, ‘Class Information’, ’tishonator_add_class_fields’, ‘class’ );

    3.3. functions.php

    $labels = array(
    ‘name’ => __( ‘Trainers‘, ’tishonator’ ),
    ‘singular_name’ => __( ‘Trainer‘, ’tishonator’ ),
    ‘add_new’ => __( ‘Add New’, ’tishonator’ ),
    ‘add_new_item’ => __( ‘Add New Trainer‘, ’tishonator’ ),
    ‘edit_item’ => __( ‘Edit Trainer‘, ’tishonator’ ),
    ‘new_item’ => __( ‘New Trainer‘, ’tishonator’ ),
    ‘view_item’ => __( ‘View Trainer‘, ’tishonator’ ),
    ‘search_items’ => __( ‘Search Trainers‘, ’tishonator’ ),
    ‘not_found’ => __( ‘No Trainers found’, ’tishonator’ ),
    ‘not_found_in_trash’ => __( ‘No Trainers found in Trash’, ’tishonator’ ),
    ‘parent_item_colon’ => __( ‘Parent Trainer:’, ’tishonator’ ),
    ‘menu_name’ => __( ‘Trainers‘, ’tishonator’ ),
    );

  4. Open single-class.php, then update the following values marked in bold:

    <?php esc_html_e(‘Class Schedule‘, ’tishonator’); ?>

    <h3><?php esc_html_e(‘Trainer‘, ’tishonator’); ?></h3>

  5. Save changes and refresh the Admin page in browser. Then instead of class in Left menu, you will see the new word (just like the screenshot above).

About the Author

Tihomir Ivanov is a WordPress and Salesforce Commerce Cloud (SFCC) developer, founder of tishonator.com, a fan of Linux and Open Source, Minimalism (in Design and Life), Sci-fi, Fantasy, Classic and History books :)

Leave a Reply