Vertoh

  1. Home
  2. Docs
  3. Vertoh
  4. Frequently Asked Questions
  5. Display events in coming soon mode.

Display events in coming soon mode.

You can display events as  ‘To Be Announced’ by making the following changes on the file.

Please activate child theme, otherwise you will lose the changed files when you upgrade the theme.

Please do remember to back-up the file prior to any change.

1) Go to Appearance->Editor->functions.php

2) Add the following code:

<?php
add_action( ‘wp_enqueue_scripts’, ‘vertoh_child_script_override’ );
function vertoh_child_script_override()
{
wp_dequeue_script( ‘vertoh-schedule’ );
wp_enqueue_script( ‘vertoh-child-schedule’, get_stylesheet_directory_uri() . ‘/js/schedule.js’, array( ‘jquery’ ) );
}
?>

3) Copy js/schedule.js from the parent theme to child theme.

4) Around line number 71, you can find:

<div class=”date”>
<span class=”time”><i class=”fa fa-clock-o”></i>’ + session.time + ‘ – ‘ + session.end_time + ‘</span>
<span class=”map”><i class=”fa fa-map-marker”></i>’ + session.location + ‘</span>
</div>

5) Please change the above code to:

<div class=”date”>’;
if(session.time){
html += ‘<span class=”time”><i class=”fa fa-clock-o”></i>’ + session.time + ‘ – ‘ + session.end_time + ‘</span>’
} else {
html += ‘<span class=”time”><i class=”fa fa-clock-o”></i>To Be Announced</span>’;
}
html += ‘<span class=”map”><i class=”fa fa-map-marker”></i>’ + session.location + ‘</span>
</div>

7) Save the file.

This will show ‘To be announced’ text if the session time is empty. Otherwise, show time.

To change this on single session page, copy single-session.php from the parent theme to child theme.

Around line number 60, you can find:

<?php echo $time; ?> – <?php echo $end_time; ?>

Please replace this with:

<?php if($time) { echo $time; ?> – <?php echo $end_time; } else { echo “To Be Announced”; }?>

Save the file.

Was this article helpful to you? Yes No