This article is OUTDATED now and this can be simply achieved with CSS as shown here:
Please go to this post for instructions on How to Remove Countries and Activities from Tour Card.
If you would like to remove countries and activities from your listings, please follow the steps below.
But first lets have a look at Before and After:
Right, I guess this is what you want. Then lets proceed:
Step 1: Please ensure that you are running the latest version of Entrada theme and Entrada Plugins and your Entrada Child theme is active. If you are not, you will not get the desired results. So, please follow the article below and make sure that you have latest Entrada Theme and Plugins installed:
How to Update Entrada Theme and Plugins to Latest Version
Step 2: Now, go to your WordPress Admin Dashboard and click on Appearance >> Editor
Step 3: In the next screen, you will see “Entrada Child” selected on top right corner and beneath that, you will see “Theme Functions” click on "“Theme Functions” as shown below.
Step 4: As shown in the screenshot above, where it says “PASTE THE CODE EXACTLY HERE”, copy the code below and paste it there.
/* Entrada Product custom functions
--------------------------------------------------------- */
if ( ! function_exists( 'entrada_destinations_activities_count' ) ) {
function entrada_destinations_activities_count($post_id, $print=false) {
$html = '';
return $html;
$post_taxonomy_count = array(
array(
'taxonomy' => 'destination',
'singular_name' => __('Country', 'entrada' ),
'plural_name' => __('Countries', 'entrada' ),
'span_class' => 'country',
'icomoon_class' => 'icon-world',
),
array(
'taxonomy' => 'product_cat',
'singular_name' => __('Activity', 'entrada' ),
'plural_name' => __('Activities', 'entrada' ),
'span_class' => 'activity',
'icomoon_class' => 'icon-acitivities',
)
);
foreach ($post_taxonomy_count as $post_taxonomy){
$term_list = wp_get_post_terms($post_id,$post_taxonomy['taxonomy'],array('fields'=>'ids'));
$total_records = count($term_list) -1 ;
if($total_records > 1){
$label = $total_records . ' '.$post_taxonomy['plural_name'];
}
else {
$label = $total_records . ' '.$post_taxonomy['singular_name'];
}
$html .= ' '.$label.'';
}
if($print == true){
echo $html;
}
else{
return $html;
}
}
}
if ( ! function_exists( 'entrada_get_addons_price' ) ) {
function entrada_get_addons_price($product_id, $addons_label) {
$addons_price = 0;
$product_addons_arr = array();
$product_addons = get_post_meta($product_id,'product_addons', true);
if(isset($product_addons) && !empty($product_addons)){
$product_addons_arr = maybe_unserialize($product_addons);
}
if($product_addons_arr){
foreach($product_addons_arr as $p_addons) {
if (in_array($addons_label, $p_addons)) {
return $p_addons['addons_price'];
}
}
}
return $addons_price;
}
}
Step 5: As shown in screenshot, click on Update File button. You will get a success message and your frontend will stop showing Countries and Activities as shown in the “After” image above.
However, if you just want to rename countries and activities, follow all the steps above apart from Step 4. On step 4, instead of the code above, copy the code below:
/* Entrada Product custom functions
--------------------------------------------------------- */
if ( ! function_exists( 'entrada_destinations_activities_count' ) ) {
function entrada_destinations_activities_count($post_id, $print=false) {
$html = '';
$post_taxonomy_count = array(
array(
'taxonomy' => 'destination',
'singular_name' => __('Country', 'entrada' ),
'plural_name' => __('Countries', 'entrada' ),
'span_class' => 'country',
'icomoon_class' => 'icon-world',
),
array(
'taxonomy' => 'product_cat',
'singular_name' => __('Activity', 'entrada' ),
'plural_name' => __('Activities', 'entrada' ),
'span_class' => 'activity',
'icomoon_class' => 'icon-acitivities',
)
);
foreach ($post_taxonomy_count as $post_taxonomy){
$term_list = wp_get_post_terms($post_id,$post_taxonomy['taxonomy'],array('fields'=>'ids'));
$total_records = count($term_list) -1 ;
if($total_records > 1){
$label = $total_records . ' '.$post_taxonomy['plural_name'];
}
else {
$label = $total_records . ' '.$post_taxonomy['singular_name'];
}
$html .= ' '.$label.'';
}
if($print == true){
echo $html;
}
else{
return $html;
}
}
}
if ( ! function_exists( 'entrada_get_addons_price' ) ) {
function entrada_get_addons_price($product_id, $addons_label) {
$addons_price = 0;
$product_addons_arr = array();
$product_addons = get_post_meta($product_id,'product_addons', true);
if(isset($product_addons) && !empty($product_addons)){
$product_addons_arr = maybe_unserialize($product_addons);
}
if($product_addons_arr){
foreach($product_addons_arr as $p_addons) {
if (in_array($addons_label, $p_addons)) {
return $p_addons['addons_price'];
}
}
}
return $addons_price;
}
}
And on line 9 and 10, edit Country and Countries to what you like, for example, Destination and Destinations as shown below:
'singular_name' => __('Destination', 'entrada' ),
'plural_name' => __('Destinations', 'entrada' ),
And similarly, for changing Activity and Activities to another string, on line 16 and 17, edit the string as below:
'singular_name' => __('Experience', 'entrada' ),
'plural_name' => __('Experiences', 'entrada' ),
Thank you