Vertoh

  1. Home
  2. Docs
  3. Vertoh
  4. Frequently Asked Questions
  5. How can I make the register links to open in a new window?

How can I make the register links to open in a new window?

You need some basic knowledge of WordPress theme development to perform this task.

Requirements

 

Steps

To open the register links on a new tab/window do the following:

  1. Overwrite theme’s header: From your Vertoh parent theme (wp-content/themes/vertoh), copy the file header.php to your child theme wp-content/themes/vertoh-child/. Edit the file wp-content/themes/vertoh-child/header.php around line number 108, you can find:
    <a href="<?php echo $registration_calltoaction_url; ?>"><i class="fa fa-ticket pull-right right-icon"></i></a>
    

    Replaced this to:

    <a target="_blank" href="<?php echo $registration_calltoaction_url; ?>"><i class="fa fa-ticket pull-right right-icon"></i></a>
    
  2. Overwrite slider behavior: From your Vertoh parent theme, copy the file wp-content/themes/vertoh/components/templates/headers/home/slider.php to the same path in your child theme. Edit wp-content/themes/vertoh-child/components/templates/headers/home/slider.php. Around line number 51, you can find:
    <a href="<?php echo $registration_calltoaction_url; ?>" class="section-button"><?php echo stripslashes($reg_widget['registrationcalltoactiontext']); ?></a>
    

    Changed this to :

    <a target="_blank" href="<?php echo $registration_calltoaction_url; ?>" class="section-button"><?php echo stripslashes($reg_widget['registrationcalltoactiontext']); ?></a>
    
  3. Overwrite navigation menu items: Edit the file: wp-content/themes/vertoh-child/functions.php. Add the following code to the end of this file (you don’t need to include the PHP wrapping code twice)
    <?php
    
    //To change the parent nav menu items
    
    function vertoh_child_remove_excerpt_filter() {
    
    remove_filter('wp_nav_menu_items', 'vertoh_wp_nav_menu_items', 10, 2);
    
    }
    
    add_action('after_setup_theme', 'vertoh_child_remove_excerpt_filter' );
    
    add_filter('wp_nav_menu_items', 'vertoh_child_wp_nav_menu_items', 10, 2);
    
    function vertoh_child_wp_nav_menu_items($items, $args) {
    
    $widget_ef_registration = get_option('widget_ef_registration');
    
    if ($args->theme_location == 'primary' && is_active_widget(false, false, 'ef_registration') && is_array($widget_ef_registration)) {
    
    foreach ($widget_ef_registration as $key => $reg_widget) {
    
    if (empty($reg_widget)) {
    
    unset($widget_ef_registration[$key]);
    
    update_option('widget_ef_registration', $widget_ef_registration);
    
    } elseif (isset($reg_widget['registrationshowtopmenu']) && $reg_widget['registrationshowtopmenu'] == 1) {
    
    $registration_topmenu_url = !empty($reg_widget['registrationtopmenuurl']) ? $reg_widget['registrationtopmenuurl'] : "#tile_registration_anchor";
    
    $items .= '<li class="register"><a target="_blank" href="'.$registration_topmenu_url.'" class="section-button">'.stripslashes($reg_widget['registrationtopmenutext']).'</a></li>';
    
    break;
    
    }
    
    }
    
    }
    
    return $items;
    
    }
    
    ?>
    
  4. Finally, update your child theme files: If you already have some editions into that child theme be careful to not overwrite your changes.
Was this article helpful to you? Yes No