当前位置: 首页>>代码示例>>PHP>>正文


PHP the_custom_logo函数代码示例

本文整理汇总了PHP中the_custom_logo函数的典型用法代码示例。如果您正苦于以下问题:PHP the_custom_logo函数的具体用法?PHP the_custom_logo怎么用?PHP the_custom_logo使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了the_custom_logo函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: jinn_the_site_logo

/**
 * Return early if Site Logo is not available.
 */
function jinn_the_site_logo()
{
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
    } else {
        if (function_exists('jetpack_the_site_logo')) {
            jetpack_the_site_logo();
        } else {
            return;
        }
    }
}
开发者ID:jekkilekki,项目名称:theme-jin,代码行数:15,代码来源:jetpack.php

示例2: clea_storefront_display_custom_logo

function clea_storefront_display_custom_logo()
{
    ?>
		
				
	<div class="site-branding">
		
		<?php 
    the_custom_logo();
    ?>
		
		<h1 class="site-title"><a href="<?php 
    echo esc_url(home_url('/'));
    ?>
" rel="home"><?php 
    bloginfo('name');
    ?>
</a></h1>
		<?php 
    if ('' != get_bloginfo('description')) {
        ?>
			<p class="site-description"><?php 
        echo bloginfo('description');
        ?>
</p>
		<?php 
    }
    ?>
	</div>
	<?php 
}
开发者ID:aldelpech,项目名称:clea-patrice-add-functions,代码行数:31,代码来源:clea-patrice-header-logo.php

示例3: eighteen_tags_site_branding

    /**
     * Display Site Branding
     * @since  1.0.0
     * @return void
     */
    function eighteen_tags_site_branding()
    {
        if (get_theme_mod('custom_logo') && function_exists('the_custom_logo')) {
            the_custom_logo();
        } else {
            ?>
			<div class="site-branding">
				<h1 class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1>
				<?php 
            if ('' != get_bloginfo('description')) {
                ?>
					<p class="site-description"><?php 
                bloginfo('description');
                ?>
</p>
				<?php 
            }
            ?>
			</div>
		<?php 
        }
    }
开发者ID:pootlepress,项目名称:18-tags,代码行数:33,代码来源:header.php

示例4: components_the_custom_logo

/**
 * Return early if Custom Logos are not available.
 *
 * @todo Remove after WP 4.7
 */
function components_the_custom_logo()
{
    if (!function_exists('the_custom_logo')) {
        return;
    } else {
        the_custom_logo();
    }
}
开发者ID:davidakennedy,项目名称:theme-components,代码行数:13,代码来源:functions.php

示例5: rock_the_custom_logo

/**
 * Display a custom logo.
 *
 * @since 1.0.0
 */
function rock_the_custom_logo()
{
    /**
     * For backwards compatibility prior to WordPress 4.5.
     *
     * @link  https://developer.wordpress.org/reference/functions/the_custom_logo/
     * @since 1.0.0
     */
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
        return;
    }
    $custom_logo_id = get_theme_mod('custom_logo');
    if (!$custom_logo_id && !is_customize_preview()) {
        return;
    }
    $args = array('class' => 'custom-logo', 'itemprop' => 'logo');
    printf('<a href="%1$s" class="custom-logo-link" %2$s>%3$s</a>', esc_url(home_url('/')), $custom_logo_id ? 'rel="home" itemprop="url"' : 'style="display:none;"', $custom_logo_id ? wp_get_attachment_image($custom_logo_id, 'full', false, $args) : '<img class="custom-logo"/>');
}
开发者ID:faithmade,项目名称:rock,代码行数:24,代码来源:template-tags.php

示例6: siteorigin_north_display_logo

    /**
     * Display the logo or site title
     */
    function siteorigin_north_display_logo()
    {
        $logo = siteorigin_setting('branding_logo');
        if (!empty($logo)) {
            $attrs = apply_filters('siteorigin_north_logo_attributes', array());
            ?>
<a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home">
			<span class="screen-reader-text"><?php 
            esc_html_e('Home', 'siteorigin-north');
            ?>
</span><?php 
            echo wp_get_attachment_image($logo, 'full', false, $attrs);
            ?>
</a><?php 
        } elseif (function_exists('has_custom_logo') && has_custom_logo()) {
            the_custom_logo();
        } else {
            if (is_front_page()) {
                ?>
			<h1 class="site-title"><a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" rel="home"><?php 
                bloginfo('name');
                ?>
</a></h1>
		<?php 
            } else {
                ?>
			<p class="site-title"><a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" rel="home"><?php 
                bloginfo('name');
                ?>
</a></p>
		<?php 
            }
        }
    }
开发者ID:siteorigin,项目名称:siteorigin-north,代码行数:46,代码来源:template-tags.php

示例7: jeweltheme_polmo_the_custom_logo

 /**
  * Displays the optional custom logo.
  *
  * Does nothing if the custom logo is not available.
  *
  */
 function jeweltheme_polmo_the_custom_logo()
 {
     if (function_exists('the_custom_logo')) {
         the_custom_logo();
     }
 }
开发者ID:jeweltheme,项目名称:polmo-lite,代码行数:12,代码来源:template-tags.php

示例8: skin_logo_upload_area

    function skin_logo_upload_area()
    {
        ?>
			<div class="logo">
				<?php 
        if (has_custom_logo()) {
            the_custom_logo();
        } else {
            if (is_home()) {
                ?>
							<h1 class='site-title'>
									<a href='<?php 
                echo esc_url(home_url('/'));
                ?>
' title='<?php 
                echo esc_attr(get_bloginfo('name', 'display'));
                ?>
' rel='home'> <?php 
                bloginfo('name');
                ?>
</a>
							</h1>
							<p><a href='<?php 
                echo esc_url(home_url('/'));
                ?>
' title='<?php 
                echo esc_attr(get_bloginfo('description', 'display'));
                ?>
' rel='home'> <?php 
                bloginfo('description');
                ?>
</a></p>
					<?php 
            } else {
                ?>
						<h2 class='site-title'>
						<a href='<?php 
                echo esc_url(home_url('/'));
                ?>
' title='<?php 
                echo esc_attr(get_bloginfo('name', 'display'));
                ?>
' rel='home'> <?php 
                bloginfo('name');
                ?>
</a></h2>
						<p><a href='<?php 
                echo esc_url(home_url('/'));
                ?>
' title='<?php 
                echo esc_attr(get_bloginfo('description', 'display'));
                ?>
' rel='home'> <?php 
                bloginfo('description');
                ?>
</a></p>
					<?php 
            }
        }
        ?>
			</div>
	<?php 
    }
开发者ID:TheSkin,项目名称:Skin-WordPress-Theme,代码行数:63,代码来源:functions.php

示例9: natural_lite_custom_logo

    function natural_lite_custom_logo()
    {
        if (function_exists('the_custom_logo') && has_custom_logo()) {
            if (is_front_page() && is_home()) {
                ?>
					<h1 class="site-logo"><?php 
                the_custom_logo();
                ?>
</h1>
				<?php 
            } else {
                ?>
					<p class="site-logo"><?php 
                the_custom_logo();
                ?>
</p>
				<?php 
            }
        } else {
            if (is_front_page() && is_home()) {
                ?>
					<h1 class="site-title">
						<a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" rel="home"><?php 
                echo wp_kses_post(get_bloginfo('name'));
                ?>
</a>
					</h1>
				<?php 
            } else {
                ?>
					<p class="site-title">
						<a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" rel="home"><?php 
                echo wp_kses_post(get_bloginfo('name'));
                ?>
</a>
					</p>
				<?php 
            }
        }
    }
开发者ID:Invulu,项目名称:natural-lite,代码行数:46,代码来源:functions.php

示例10: twentyfifteen_the_custom_logo

 /**
  * Displays the optional custom logo.
  *
  * Does nothing if the custom logo is not available.
  *
  * @since Twenty Fifteen 1.5
  */
 function twentyfifteen_the_custom_logo()
 {
     if (function_exists('the_custom_logo')) {
         the_custom_logo();
     }
 }
开发者ID:diductio,项目名称:D,代码行数:13,代码来源:template-tags.php

示例11: morfeu_the_custom_logo

/**
 * Morfeu Custom Logo
 */
function morfeu_the_custom_logo()
{
    if (function_exists('the_custom_logo') && has_custom_logo()) {
        the_custom_logo();
    } else {
        ?>
		<a class="navbar-brand clearfix" href="<?php 
        echo esc_url(home_url('/'));
        ?>
" title="<?php 
        echo esc_attr(get_bloginfo('name', 'display'));
        ?>
" rel="home">
			<h1 class='site-title'><?php 
        bloginfo('name');
        ?>
</h1>
		</a>
	<?php 
    }
}
开发者ID:rodrigo-brito,项目名称:morfeu-theme,代码行数:24,代码来源:functions.php

示例12: sds_logo

    function sds_logo()
    {
        global $sds_theme_options;
        // Determine HTML wrapper element
        $sds_logo_wrapper_el = is_front_page() || is_home() ? 'h1' : 'p';
        //Logo (WordPress 4.5 and up)
        if (SDS_Theme_Options::wp_version_compare('4.5') && function_exists('the_custom_logo') && ($custom_logo = get_theme_mod('custom_logo'))) {
            ?>
		<<?php 
            echo $sds_logo_wrapper_el;
            ?>
 id="title" class="site-title site-title-logo has-logo">
			<?php 
            the_custom_logo();
            ?>
		</<?php 
            echo $sds_logo_wrapper_el;
            ?>
>
	<?php 
            // Logo (below WordPress 4.5)
        } elseif (!empty($sds_theme_options['logo_attachment_id'])) {
            ?>
		<<?php 
            echo $sds_logo_wrapper_el;
            ?>
 id="title" class="site-title site-title-logo has-logo">
			<a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" title="<?php 
            echo esc_attr(get_bloginfo('name'));
            ?>
" rel="home" itemprop="url">
				<?php 
            echo wp_get_attachment_image($sds_theme_options['logo_attachment_id'], 'full');
            ?>
			</a>
		</<?php 
            echo $sds_logo_wrapper_el;
            ?>
>
	<?php 
            // No logo
        } else {
            ?>
		<<?php 
            echo $sds_logo_wrapper_el;
            ?>
 id="title" class="site-title site-title-no-logo no-logo">
			<a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" title="<?php 
            echo esc_attr(get_bloginfo('name'));
            ?>
" rel="home" itemprop="url">
				<?php 
            bloginfo('name');
            ?>
			</a>
		</<?php 
            echo $sds_logo_wrapper_el;
            ?>
>
	<?php 
        }
    }
开发者ID:sdsweb,项目名称:baton,代码行数:68,代码来源:theme-functions.php

示例13: creative_blog_header_text_logo

    function creative_blog_header_text_logo()
    {
        ?>
        <div id="logo-and-title" class="logo-and-title col-md-4">
            <?php 
        if (function_exists('the_custom_logo')) {
            the_custom_logo();
        }
        ?>

            <div class="site-info">
                <?php 
        if (is_front_page() && is_home()) {
            ?>
                    <h1 class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            bloginfo('name');
            ?>
</a></h1>
                <?php 
        } else {
            ?>
                    <p class="site-title"><a href="<?php 
            echo esc_url(home_url('/'));
            ?>
" rel="home"><?php 
            bloginfo('name');
            ?>
</a></p>
                <?php 
        }
        ?>
                <p class="site-description"><?php 
        bloginfo('description');
        ?>
</p>
            </div><!-- .site-info -->
        </div>

        <?php 
    }
开发者ID:mebishalnapit,项目名称:creative-blog,代码行数:43,代码来源:extras.php

示例14: test_the_custom_logo

 /**
  * @group custom_logo
  *
  * @since 4.5.0
  */
 function test_the_custom_logo()
 {
     $this->expectOutputString('');
     the_custom_logo();
     $this->_set_custom_logo();
     $size = get_theme_support('custom-logo', 'size');
     $size = $size ? $size : 'full';
     $image = wp_get_attachment_image($this->custom_logo_id, $size, false, array('class' => "custom-logo attachment-{$size}", 'data-size' => $size, 'itemprop' => 'logo'));
     $this->expectOutputString('<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>');
     the_custom_logo();
 }
开发者ID:jaspermdegroot,项目名称:develop.wordpress,代码行数:16,代码来源:template.php

示例15: wedlock_the_custom_logo

/**
 * Output custom logo.
 */
function wedlock_the_custom_logo()
{
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
    }
}
开发者ID:Awothemes,项目名称:Wedlock,代码行数:9,代码来源:template-tags.php


注:本文中的the_custom_logo函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。