function wpml_get_home_url(){ if(function_exists('icl_get_home_url')){ return icl_get_home_url(); }else{ return rtrim(get_bloginfo('url') , '/') . '/'; } }
/** * Function to format and display the search bar in the main menu * * @return string * @added 2.0 */ static function searchBar() { /* Added for WPML Compatibility in 2.2 * Thanks to miguelcortereal for this */ $action = function_exists('icl_get_home_url') ? icl_get_home_url() : get_home_url(); ?> <form action="<?php echo $action; ?> " id="responsiveSearch" method="get" role="search"> <span class="icon-buscador"> <img src="<?php echo get_home_url(); ?> /wp-content/themes/quidus/img/lupa.png" alt="Lupa"> </span> <span class="caja-texto"> <input type="search" name="s" class="form-control" value="" placeholder="Buscar"> </span> <input type="submit" id="responsiveSearchSubmit" /> </form> <?php }
public function getWpUrl() { if (function_exists("icl_get_home_url")) { return icl_get_home_url(); } return get_bloginfo("wpurl"); }
function filter_options() { global $bfa_ata; $bfa_ata['get_option_home'] = rtrim(icl_get_home_url(), '/'); foreach ($this->translatable_strings as $string) { $bfa_ata[$string] = icl_t('theme ' . $this->name, $this->make_title($string), $bfa_ata[$string]); } }
function presscore_wpml_get_home_url() { if (function_exists('icl_get_home_url')) { return icl_get_home_url(); } else { return rtrim(home_url(), '/') . '/'; } }
function base_wpml_home_page_url() { if (function_exists('icl_get_home_url')) { $base_home_url = icl_get_home_url(); } else { $base_home_url = get_site_url(); } return $base_home_url; }
function smc_wpcs_correct_domain_in_url($url) { if (function_exists('icl_get_home_url')) { // Use the language switcher object, because that contains WPML settings, and it's available globally global $icl_language_switcher; // Only make the change if we're using the languages-per-domain option if (isset($icl_language_switcher->settings['language_negotiation_type']) && $icl_language_switcher->settings['language_negotiation_type'] == 2) { return str_replace(untrailingslashit(get_option('home')), untrailingslashit(icl_get_home_url()), $url); } } return $url; }
function add_thematic_blogtitle() { ?> <div id="blog-title"><span><a href="<?php echo icl_get_home_url(); ?> " title="<?php bloginfo('name'); ?> " rel="home"><?php bloginfo('name'); ?> </a></span></div> <?php }
function is_swp_registered() { // Fetch the User's Options Array $swp_user_options = get_option('socialWarfareOptions'); // Create a Registration Code from the Domain Name if (function_exists('icl_get_home_url')) { $domain = icl_get_home_url(); } else { $domain = get_home_url(); } $regCode = md5($domain); // If the Premium Code is currently set.... if (isset($swp_user_options['premiumCode']) && md5($regCode) == $swp_user_options['premiumCode']) { // It's registered return true; // IF the premium code doesn't match.... } else { // It's not registered return 0; } }
/** * Function to format and display the search bar in the main menu * * @return string * @added 2.0 */ static function searchBar() { /* Added for WPML Compatibility in 2.2 * Thanks to miguelcortereal for this */ $action = function_exists('icl_get_home_url') ? icl_get_home_url() : get_home_url(); ?> <form action="<?php echo $action; ?> " id="responsiveSearch" method="get" role="search"> <input type="search" name="s" value="" placeholder="<?php _e('Search', 'responsive-menu'); ?> " id="responsiveSearchInput"> <input type="submit" id="responsiveSearchSubmit" /> </form> <?php }
function suffusion_display_header() { global $suf_sub_header_vertical_alignment, $suf_header_fg_image_type, $suf_header_fg_image, $suf_header_alignment, $suf_sub_header_alignment; $display = apply_filters('suffusion_can_display_header', true); if (!$display) { return; } if ($suf_header_alignment == 'right') { suffusion_display_widgets_in_header(); } if (!is_singular()) { $header_tag = "h1"; } else { $header_tag = "h2"; } ?> <header id="header" class="fix"> <?php $header = $suf_header_fg_image_type == 'image' && trim($suf_header_fg_image) != '' ? "<img src='{$suf_header_fg_image}' alt='" . esc_attr(get_bloginfo('name')) . "'/>" : get_bloginfo('name', 'display'); $home_link = home_url(); if (function_exists('icl_get_home_url')) { $home_link = icl_get_home_url(); } if ($suf_sub_header_vertical_alignment == "above") { ?> <div class="description <?php echo $suf_sub_header_alignment; ?> "><?php bloginfo('description'); ?> </div> <<?php echo $header_tag; ?> class="blogtitle <?php echo $suf_header_alignment; ?> "><a href="<?php echo $home_link; ?> "><?php echo $header; ?> </a></<?php echo $header_tag; ?> > <?php } else { ?> <<?php echo $header_tag; ?> class="blogtitle <?php echo $suf_header_alignment; ?> "><a href="<?php echo $home_link; ?> "><?php echo $header; ?> </a></<?php echo $header_tag; ?> > <div class="description <?php echo $suf_sub_header_alignment; ?> "><?php bloginfo('description'); ?> </div> <?php } ?> </header><!-- /header --> <?php if ($suf_header_alignment != 'right') { suffusion_display_widgets_in_header(); } }
* * @action Before the template: 'us_before_template:templates/widgets/contacts' * @action After the template: 'us_after_template:templates/widgets/contacts' */ $class_name = ''; if (us_get_option('logo_type', 'text') == 'text') { $class_name .= ' with_title'; $logo_text = us_get_option('logo_text') ? us_get_option('logo_text') : bloginfo('name'); } else { if (us_get_option('logo_image_transparent')) { $class_name = ' with_transparent'; } $default_logo_url = us_get_option('logo_image'); $transparent_logo_url = us_get_option('logo_image_transparent'); } $home_url = function_exists('icl_get_home_url') ? icl_get_home_url() : esc_url(home_url('/')); ?> <div class="w-logo <?php echo $class_name; ?> "> <a class="w-logo-link" href="<?php echo $home_url; ?> "> <?php if (us_get_option('logo_type', 'text') == 'img') { ?> <span class="w-logo-img"> <?php
function arjuna_print_page_menu() { $arjunaOptions = arjuna_get_options(); $html = ''; $html .= '<ul id="headerMenu2">'; if ($arjunaOptions['menus']['2']['displayHome']) { $html .= '<li><a href="' . (function_exists('icl_get_home_url') ? icl_get_home_url() : home_url('/')) . '" class="homeIcon">' . __('Home', 'Arjuna') . '</a></li>'; } $html .= wp_list_pages('title_li=&echo=0&depth=' . $arjunaOptions['menus']['2']['depth']); $html .= '</ul>'; print $html; }
/** * Fix "get_term_link" for this taxonomy. */ public function term_link_filter($termlink, $term, $taxonomy) { // check if the post type is handle if (isset($this->taxonomies[$taxonomy])) { if (!is_object($term)) { if (is_int($term)) { $term = get_term($term, $taxonomy); } else { $term = get_term_by('slug', $term, $taxonomy); } } if (!is_object($term)) { $term = new WP_Error('invalid_term', __('Empty Term')); } if (empty($term) || is_wp_error($term)) { return $term; } // get the term language if ($this->plugin === 'Polylang') { $lang = $this->get_term_language($term->term_id); } else { $lang = $this->get_term_language($term->term_taxonomy_id); } // check if the language is handle if (isset($this->taxonomies[$taxonomy]->translated_slugs[$lang])) { $taxonomy = $term->taxonomy; $slug = $term->slug; $t = get_taxonomy($taxonomy); if (empty($termlink)) { if ($taxonomy == 'category') { $termlink = '?cat=' . $term->term_id; } elseif ($t->query_var) { $termlink = "?{$t->query_var}={$slug}"; } else { $termlink = "?taxonomy={$taxonomy}&term={$slug}"; } $termlink = esc_url(icl_get_home_url() . $termlink); } else { // @TODO: replace default home url with current lang home url? if ($this->plugin === 'Polylang') { // $termlink = str_replace( untrailingslashit( home_url() ), untrailingslashit( pll_home_url() ), $termlink ); } $termlink = esc_url(str_replace($t->rewrite['slug'], $this->taxonomies[$taxonomy]->translated_slugs[$lang], $termlink)); } // backward compatibility filters if ($taxonomy == 'post_tag') { $termlink = apply_filters('tag_link', $termlink, $term->term_id); } elseif ($taxonomy == 'category') { $termlink = apply_filters('category_link', $termlink, $term->term_id); } } } return apply_filters('wpml_translated_term_link', $termlink); }
function get_base_url() { if (function_exists('icl_get_home_url')) { return icl_get_home_url(); } return get_home_url(); }
function init($blog_id = 0) { global $knewsOptions, $wpdb; if ($blog_id != 0 && $this->im_networked()) { switch_to_blog($blog_id); } if (!$this->basic_initialized) { $this->basic_init($blog_id); } global $KnewsAdminOptions; define('KNEWS_MULTILANGUAGE', $this->check_multilanguage_plugin($KnewsAdminOptions['multilanguage_knews'])); $this->creaSiNoExisteixDB(); $this->knewsLangs = $this->getLangs(); //LOCALIZED URLS (WPML different domains for language option) $knews_localized_url = KNEWS_URL; $knews_localized_admin = get_admin_url(); if (KNEWS_MULTILANGUAGE && $knewsOptions['multilanguage_knews'] == 'wpml') { if (function_exists('icl_get_languages')) { global $sitepress_settings; if (isset($sitepress_settings['language_negotiation_type']) && $sitepress_settings['language_negotiation_type'] == 2) { //$l = $this->pageLang(); //$knews_localized_url = $l['url']; $knews_localized_url = icl_get_home_url(); if (substr($knews_localized_url, -1) != '/') { $knews_localized_url .= '/'; } $knews_localized_admin = $knews_localized_url . 'wp-admin/'; $knews_localized_url .= KNEWS_WP_CONTENT . '/plugins/knews'; } } } define('KNEWS_LOCALIZED_URL', $knews_localized_url); define('KNEWS_LOCALIZED_ADMIN', $knews_localized_admin); $this->initialized = true; }
echo $term->description; ?> </p> </div>--> <header class="archive-header"> <?php $categories = get_terms('annee_agenda', array('orderby' => 'count', 'hide_empty' => true)); echo "<ul class='flat'>"; foreach ($categories as $term) { //echo icl_object_id($term->term_id,'annee_agenda',true, ICL_LANGUAGE_CODE).' '; //if($term->term_id == icl_object_id($term->term_id,'annee_agenda',false)){ echo "<li class='clr-bc'><a href='" . icl_get_home_url() . "annee_agenda/" . $term->slug . "'>" . $term->name . "</a></li>"; //echo '<li><a href="'.$category_url.'?annee_agenda='. $term->slug.'">' . $term->name . '</a></li>'; //} } echo "</ul>"; $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); ?> <!--<h1><?php echo $term->name; ?> </h1>--> <!--<div class="intro2"> <p> <?php echo $term->description; ?>
<div class="l-subheader at_bottom"> <div class="l-subheader-h i-widgets i-cf"> <div class="w-logo <?php if (@$smof_data['logo_as_text'] == 1) { echo ' with_title'; } if (!empty($smof_data['custom_logo_transparent'])) { echo ' with_transparent'; } ?> "> <a class="w-logo-link" id="main-logo" href="<?php if (function_exists('icl_get_home_url')) { echo icl_get_home_url(); } else { echo esc_url(home_url('/')); } ?> "></a> </div> <div id="header-rightCol"> <?php wp_nav_menu(array('theme_location' => 'header-menu', 'container_class' => 'header-menu', 'fallback_cb' => '')); ?> <?php get_search_form(); ?>
public static function clean_wpml_home_url() { $home_url = rtrim(icl_get_home_url(), '/'); $search_string = '/' . ICL_LANGUAGE_CODE; $home_url = str_replace($search_string, '', $home_url); // gets rid of the language code at the end of the url generated by wpml $search_string = '?lang=' . ICL_LANGUAGE_CODE; $home_url = str_replace($search_string, '', $home_url); // in case it was the other option of wpml, gets rid of the language code at the end of the url generated by wpml return $home_url; }
private function _purge_homepage() { // WPML installetd? if (function_exists('icl_get_home_url')) { $homepage_url = trailingslashit(icl_get_home_url()); $this->log(sprintf(__("Purging homepage (WPML) '%s'", "nginx-helper"), $homepage_url)); } else { $homepage_url = trailingslashit(home_url()); $this->log(sprintf(__("Purging homepage '%s'", "nginx-helper"), $homepage_url)); } $this->purgeUrl($homepage_url); return true; }
public function zeo_get_url($query) { if ($query->is_404 || $query->is_search) { return false; } $haspost = count($query->posts) > 0; $has_ut = function_exists('user_trailingslashit'); if (get_query_var('m')) { $m = preg_replace('/[^0-9]/', '', get_query_var('m')); switch (strlen($m)) { case 4: $link = get_year_link($m); break; case 6: $link = get_month_link(substr($m, 0, 4), substr($m, 4, 2)); break; case 8: $link = get_day_link(substr($m, 0, 4), substr($m, 4, 2), substr($m, 6, 2)); break; default: return false; } } elseif (($query->is_single || $query->is_page) && $haspost) { $post = $query->posts[0]; $link = get_permalink($post->ID); $link = $this->zeo_get_paged($link); } elseif (($query->is_single || $query->is_page) && $haspost) { $post = $query->posts[0]; $link = get_permalink($post->ID); $link = $this->zeo_get_paged($link); } elseif ($query->is_author && $haspost) { global $wp_version; if ($wp_version >= '2') { $author = get_userdata(get_query_var('author')); if ($author === false) { return false; } $link = get_author_link(false, $author->ID, $author->user_nicename); } else { global $cache_userdata; $userid = get_query_var('author'); $link = get_author_link(false, $userid, $cache_userdata[$userid]->user_nicename); } } elseif ($query->is_category && $haspost) { $link = get_category_link(get_query_var('cat')); $link = $this->zeo_get_paged($link); } else { if ($query->is_tag && $haspost) { $tag = get_term_by('slug', get_query_var('tag'), 'post_tag'); if (!empty($tag->term_id)) { $link = get_tag_link($tag->term_id); } $link = $this->zeo_get_paged($link); } elseif ($query->is_day && $haspost) { $link = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')); } elseif ($query->is_month && $haspost) { $link = get_month_link(get_query_var('year'), get_query_var('monthnum')); } elseif ($query->is_year && $haspost) { $link = get_year_link(get_query_var('year')); } elseif ($query->is_home) { if (get_option('show_on_front') == 'page' && ($pageid = get_option('page_for_posts'))) { $link = get_permalink($pageid); $link = $this->zeo_get_paged($link); $link = trailingslashit($link); } else { if (function_exists('icl_get_home_url')) { $link = icl_get_home_url(); } else { $link = get_option('home'); } $link = $this->zeo_get_paged($link); $link = trailingslashit($link); } } elseif ($query->is_tax && $haspost) { $taxonomy = get_query_var('taxonomy'); $term = get_query_var('term'); $link = get_term_link($term, $taxonomy); $link = $this->zeo_get_paged($link); } else { return false; } } return $link; }
function oxy_get_home_url() { if (function_exists('icl_get_home_url')) { $home_link = icl_get_home_url(); } else { $home_link = site_url(); } return $home_link; }
<?php //Get Theme Options details $logo = xr_get_option('company_logo', ''); $social_icons = json_decode(xr_get_option('social_icons', ''), true); $header_contact_info = xr_get_option('header_contact_info', ''); $use_header_top_2 = false; //Add Html tags to elements $logo_html = '<div class="logo-container"><a href="' . (function_exists('icl_get_home_url') ? icl_get_home_url() : get_site_url()) . '"><img src="' . $logo . '" alt="' . get_bloginfo('name') . '" style="max-width:' . xr_get_option('logo_width', '190px') . '; max-height:' . xr_get_option('logo_height', '80px') . '; width:100%;" /></a></div>'; $social_html = '<div class="header-social-container">' . do_shortcode($social_icons['shortcode']) . '</div>'; $header_contact_html = '<div class="header-small-contact">' . $header_contact_info . '</div>'; ob_start(); do_action('icl_language_selector'); $wpml_select = ob_get_contents(); $wpml_select = '<div class="header-wpml-container">' . $wpml_select . '</div>'; ob_get_clean(); $add_woo_icon_to_menu = rockthemes_woocommerce_active() && xr_get_option('add_cart_icon_to_menu', false) ? true : false; if ($add_woo_icon_to_menu) { add_filter('wp_nav_menu_items', 'rockthemes_add_cart_icon_to_menu', 10, 2); } $menu_shadow = xr_get_option('activate_menu_bottom_shadow', '1') !== '' ? quasar_image_shadow_down() : ''; /* ** Header Models ** ** 1 - Full width menu, Left Logo, Right Middle Social Icons, Right Top Call Us, Right Bottom WPML ** 2 - Full width menu, Centered Logo, Left Bottom Social Icons, Left Top Call Us, Right Top WPML ** 3 - Right menu, Left Logo, ** 4 - Full width menu, Left Logo, Right Middle Social Icons, Right Top Call Us, Right Bottom WPML ** ** **
if (!$logo_url) { $logo_url = THEMEURL . 'images/kolor.png'; } ?> <!-- site header container --> <div class="container header_menu_container"> <!-- site logo and menu container --> <div class="site_logo_menu"> <!-- site logo --> <div class="four columns logo"> <a href="<?php echo is_wpml() ? icl_get_home_url() : site_url('/'); ?> "> <img src="<?php echo $logo_url; ?> " /> <?php if ($retina_logo_url) { $upload_dir = wp_upload_dir(); $image_path = ABSPATH . str_replace(site_url('/'), '', $retina_logo_url); $retina_logo_width = ''; if (file_exists($image_path)) { $retina_logo_width = getimagesize($image_path); $retina_logo_width = intval($retina_logo_width[0] / 2); }
/** * @param $query * @param bool $show_page * * @return bool|false|string */ function aiosp_mrt_get_url($query, $show_page = true) { if ($query->is_404 || $query->is_search) { return false; } $link = ''; $haspost = count($query->posts) > 0; if (get_query_var('m')) { $m = preg_replace('/[^0-9]/', '', get_query_var('m')); switch ($this->strlen($m)) { case 4: $link = get_year_link($m); break; case 6: $link = get_month_link($this->substr($m, 0, 4), $this->substr($m, 4, 2)); break; case 8: $link = get_day_link($this->substr($m, 0, 4), $this->substr($m, 4, 2), $this->substr($m, 6, 2)); break; default: return false; } } elseif ($query->is_home && get_option('show_on_front') == 'page' && ($pageid = get_option('page_for_posts'))) { $link = get_permalink($pageid); } elseif (is_front_page() || $query->is_home && (get_option('show_on_front') != 'page' || !get_option('page_for_posts'))) { if (function_exists('icl_get_home_url')) { $link = icl_get_home_url(); } else { $link = trailingslashit(home_url()); } } elseif (($query->is_single || $query->is_page) && $haspost) { $post = $query->posts[0]; $link = get_permalink($post->ID); } elseif ($query->is_author && $haspost) { $author = get_userdata(get_query_var('author')); if (false === $author) { return false; } $link = get_author_posts_url($author->ID, $author->user_nicename); } elseif ($query->is_category && $haspost) { $link = get_category_link(get_query_var('cat')); } elseif ($query->is_tag && $haspost) { $tag = get_term_by('slug', get_query_var('tag'), 'post_tag'); if (!empty($tag->term_id)) { $link = get_tag_link($tag->term_id); } } elseif ($query->is_day && $haspost) { $link = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')); } elseif ($query->is_month && $haspost) { $link = get_month_link(get_query_var('year'), get_query_var('monthnum')); } elseif ($query->is_year && $haspost) { $link = get_year_link(get_query_var('year')); } elseif ($query->is_tax && $haspost) { $taxonomy = get_query_var('taxonomy'); $term = get_query_var('term'); if (!empty($term)) { $link = get_term_link($term, $taxonomy); } } elseif ($query->is_archive && function_exists('get_post_type_archive_link') && ($post_type = get_query_var('post_type'))) { if (is_array($post_type)) { $post_type = reset($post_type); } $link = get_post_type_archive_link($post_type); } else { return false; } if (empty($link) || !is_string($link)) { return false; } if (apply_filters('aioseop_canonical_url_pagination', $show_page)) { $link = $this->get_paged($link); } if (!empty($link)) { global $aioseop_options; if (isset($aioseop_options['aiosp_can_set_protocol']) && 'auto' !== $aioseop_options['aiosp_can_set_protocol']) { if ('http' === $aioseop_options['aiosp_can_set_protocol']) { $link = preg_replace('/^https:/i', 'http:', $link); } elseif ('https' === $aioseop_options['aiosp_can_set_protocol']) { $link = preg_replace('/^http:/i', 'https:', $link); } } } return $link; }
function avia_wpml_translate_all_search_results_url($search_messages, $search_query) { $search_messages['all_results_link'] = icl_get_home_url() . '?' . $search_messages['all_results_query']; return $search_messages; }
function aiosp_mrt_get_url($query) { if ($query->is_404 || $query->is_search) { return false; } $haspost = count($query->posts) > 0; if (get_query_var('m')) { $m = preg_replace('/[^0-9]/', '', get_query_var('m')); switch ($this->strlen($m)) { case 4: $link = get_year_link($m); break; case 6: $link = get_month_link($this->substr($m, 0, 4), $this->substr($m, 4, 2)); break; case 8: $link = get_day_link($this->substr($m, 0, 4), $this->substr($m, 4, 2), $this->substr($m, 6, 2)); break; default: return false; } } elseif (($query->is_single || $query->is_page) && $haspost) { $post = $query->posts[0]; $link = get_permalink($post->ID); } elseif ($query->is_author && $haspost) { $author = get_userdata(get_query_var('author')); if ($author === false) { return false; } $link = get_author_posts_url($author->ID, $author->user_nicename); } elseif ($query->is_category && $haspost) { $link = get_category_link(get_query_var('cat')); } elseif ($query->is_tag && $haspost) { $tag = get_term_by('slug', get_query_var('tag'), 'post_tag'); if (!empty($tag->term_id)) { $link = get_tag_link($tag->term_id); } } elseif ($query->is_day && $haspost) { $link = get_day_link(get_query_var('year'), get_query_var('monthnum'), get_query_var('day')); } elseif ($query->is_month && $haspost) { $link = get_month_link(get_query_var('year'), get_query_var('monthnum')); } elseif ($query->is_year && $haspost) { $link = get_year_link(get_query_var('year')); } elseif ($query->is_home) { if (get_option('show_on_front') == 'page' && ($pageid = get_option('page_for_posts'))) { $link = get_permalink($pageid); } else { if (function_exists('icl_get_home_url')) { $link = icl_get_home_url(); } else { $link = get_option('home'); } } } elseif ($query->is_tax && $haspost) { $taxonomy = get_query_var('taxonomy'); $term = get_query_var('term'); $link = get_term_link($term, $taxonomy); } elseif ($query->is_archive && function_exists('get_post_type_archive_link') && ($post_type = get_query_var('post_type'))) { $link = get_post_type_archive_link($post_type); } else { return false; } return $this->yoast_get_paged($link); }
function filter_home_link($menu) { return str_replace('href="' . get_option('home') . '"', 'href="' . icl_get_home_url() . '"', $menu); }
<?php get_header(); ?> <div class="page404Content clear"> <h1><?php esc_html_e('404', 'bauhaus'); ?> </h1> <p><?php esc_html_e('The page you are looking for does not exist', 'bauhaus'); ?> </p> <div class="clear"></div> <a href="<?php if (function_exists('icl_get_languages')) { echo esc_url(icl_get_home_url()); } else { echo esc_url(home_url('/')); } ?> " class="linkToHome"><?php esc_html_e('homepage', 'bauhaus'); ?> </a> </div> <?php get_footer();