Tour Master – Add category/tags in tour post

The developer documentation assumes you have knowledge and coding skills. While we created these docs to help you achieve things not available in the original features, we do not provide support if something doesn’t work when referencing the developer documentation. If the example code doesn’t work for you, please debug it yourself or hire a freelancer to help with debugging.

All customizations will be lost when you update our theme/plugin to a new version in the future. To avoid this, you must use filters and actions: https://developer.wordpress.org/plugins/hooks/.

The default title in tour post only support for tour title and review. Today we’ll help you know how to add tour category and tour tag in tour post.

Please open these files:

  • wp-content/plugins/tourmaster/single/tour.php
  • wp-content/plugins/tourmaster/single/tour-2.php

In the line 249, you can see the default code here:

if( empty($tour_option['enable-page-title']) || $tour_option['enable-page-title'] == 'enable' ){
    echo '<h1 class="tourmaster-single-header-title" >' . get_the_title() . '</h1>';
} 

Then change it to:

if( empty($tour_option['enable-page-title']) || $tour_option['enable-page-title'] == 'enable' ){
    echo '<h1 class="tourmaster-single-header-title" >' . get_the_title() . '</h1>';
    echo (esc_html__('Categories: ', 'tourmaster') . get_the_term_list( get_the_ID(), 'tour_category', '', ', ' ));
    echo '&lt;br&gt;' . (esc_html__('Tags: ', 'tourmaster') . get_the_term_list( get_the_ID(), 'tour_tag', '', ', ' ));
}

And check it again.