本文整理汇总了PHP中icl_get_home_url函数的典型用法代码示例。如果您正苦于以下问题:PHP icl_get_home_url函数的具体用法?PHP icl_get_home_url怎么用?PHP icl_get_home_url使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了icl_get_home_url函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpml_get_home_url
function wpml_get_home_url(){
if(function_exists('icl_get_home_url')){
return icl_get_home_url();
}else{
return rtrim(get_bloginfo('url') , '/') . '/';
}
}
示例2: searchBar
/**
* 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
}
示例3: getWpUrl
public function getWpUrl()
{
if (function_exists("icl_get_home_url")) {
return icl_get_home_url();
}
return get_bloginfo("wpurl");
}
示例4: filter_options
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]);
}
}
示例5: presscore_wpml_get_home_url
function presscore_wpml_get_home_url()
{
if (function_exists('icl_get_home_url')) {
return icl_get_home_url();
} else {
return rtrim(home_url(), '/') . '/';
}
}
示例6: base_wpml_home_page_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;
}
示例7: smc_wpcs_correct_domain_in_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;
}
示例8: add_thematic_blogtitle
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
}
示例9: is_swp_registered
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;
}
}
示例10: searchBar
/**
* 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
}
示例11: suffusion_display_header
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();
}
}
示例12: us_get_option
*
* @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
示例13: arjuna_print_page_menu
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;
}
示例14: term_link_filter
/**
* 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);
}
示例15: get_base_url
function get_base_url()
{
if (function_exists('icl_get_home_url')) {
return icl_get_home_url();
}
return get_home_url();
}