Tour Master – Add category/tags in tour post

The docs for developer mean you must have knowledge and coding skill. Although, we’re create the docs for developer to help you achieve something not available in original feature, but we don’t provide support for anything not work when you reference with docs for developer. If the example code not work for you, please debug it by your-self or hire a freelancer to debug it for you instead.

All the customize will lose when you update our theme/plugin to new version in future. To avoid it, you must use filter and action: 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.