/**
* Sage includes
*
* The $sage_includes array determines the code library included in your theme.
* Add or remove files to the array as needed. Supports child theme overrides.
*
* Please note that missing files will produce a fatal error.
*
* @link https://github.com/roots/sage/pull/1042
*/
$sage_includes = [
'lib/assets.php', // Scripts and stylesheets
'lib/extras.php', // Custom functions
'lib/setup.php', // Theme setup
'lib/titles.php', // Page titles
'lib/wrapper.php', // Theme wrapper class
'lib/customizer.php' // Theme customizer
];
foreach ($sage_includes as $file) {
if (!$filepath = locate_template($file)) {
trigger_error(sprintf(__('Error locating %s for inclusion', 'sage'), $file), E_USER_ERROR);
}
require_once $filepath;
}
unset($file, $filepath);
function get_asset($relativePath) {
return get_template_directory_uri().'/assets/'.$relativePath;
}
function get_svg($name){
return file_get_contents(get_template_directory_uri()."/assets/svg/".$name.".svg");
}
function the_svg($name){
echo get_svg($name);
}
function get_svg_icon($name){
return file_get_contents(get_template_directory_uri()."/assets/svg/icons/".$name.".svg");
}
function the_svg_icon($name){
echo get_svg_icon($name);
}
function the_button($field,$class=false){
set_query_var('btn_field',$field);
set_query_var('btn_class',$class);
get_template_part('templates/button');
}
function the_quote($quote){
set_query_var('quote',$quote);
get_template_part('templates/content','quote');
}
function button_shortcode($atts, $content=null){
$a = shortcode_atts( array(
'icon' => '',
'url' => '#',
'class' => '',
), $atts );
$button = array(
'text' => $content,
'type' => 'url',
'url' => $a['url'],
'icon' => $a['icon']
);
ob_start();
the_button($button,esc_attr($a['class']));
$the_button = ob_get_clean();
return $the_button;
}
add_shortcode('btn', 'button_shortcode');
function quote_shortcode($atts, $content=null){
$a = shortcode_atts( array(
'from' => '',
'class' => '',
), $atts );
$quote = array(
'content' => $content,
'from' => $a['from'],
'class' => $a['class']
);
ob_start();
the_quote($quote);
$the_quote = ob_get_clean();
return $the_quote;
}
add_shortcode('quote', 'quote_shortcode');
function custom_nav_classes( $classes, $item ) {
$classes[] = 'nav__item';
if (in_array('current-menu-item', $classes) ){
$classes[] = 'nav__item--current';
}
return $classes;
}
add_filter( 'nav_menu_css_class', 'custom_nav_classes', 10, 2 );
if( function_exists('acf_add_options_page') ) {
acf_add_options_page();
}
function get_gmaps_api_key() {
return 'AIzaSyDHdODI4k0_tpfVxmo1HC_0eMw3ACy74Cs';
}
function my_acf_google_map_api( $api ){
$api['key'] = get_gmaps_api_key();
return $api;
}
add_filter('acf/fields/google_map/api', 'my_acf_google_map_api');
function add_cpt_author( $query ) {
if ( !is_admin() && $query->is_author() && $query->is_main_query() ) {
$query->set( 'post_type', array('post', 'news' ) );
}
}
add_action( 'pre_get_posts', 'add_cpt_author' );
function br2sp($string) {
return preg_replace('/\ Key Solution will participate in the exhibition and the conferences to expand our customer network and understand the needs of the oil & gas market.
/i', " ", $string);
}
function check_url_target($url) {
// Abort if parameter URL is empty
if( empty($url) ) {
return false;
}
// Parse home URL and parameter URL
$link_url = parse_url( $url );
$home_url = parse_url( home_url() ); // Works for WordPress
//$home_url = parse_url( $_SERVER['HTTP_HOST'] );
// Decide on target
if( $url[0] == '#' || $link_url['host'] == $home_url['host'] ) {
return 'int';
} else {
return 'ext';
}
}
Offshore Energy 2017 Exhibition & Conference
Offshore Energy attracts a global audience of more than 11,500 offshore energy industry professionals. The three-day event, features an exhibition where over 667 companies will showcase their products and services. The accompanying conference addresses current and future issues in the offshore industry, covering developments in oil & gas, offshore wind and marine energy.
Offshore Energy Exhibition: 10 & 11 October 2017
Offshore Energy Conference: 9, 10 & 11 October 2017
Key Solution will participate in the following events:
• Offshore Energy Exhibition 10 & 11 October 2017
• Technical Session: Ten years of innovation – what’s next?
• Technical Session: Smart maintenance solutions for offshore installations
• Technical Session: The Rise of Renewables
• Technical Session: Global business opportunities
• Special Event: Networking Event
• Keynote: Industry Panel
• Side Event: EUROS for wind energy