• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP the_custom_logo函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: munsa_lite_the_custom_logo

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


示例17: ubuntugnome_the_site_logo

/**
 * Return early if Site Logo is not available.
 */
function ubuntugnome_the_site_logo()
{
    if (!function_exists('the_custom_logo')) {
        return;
    } else {
        the_custom_logo();
    }
}
开发者ID:UbuntuGNOMEMarketing,项目名称:ubuntugnome,代码行数:11,代码来源:theme.php


示例18: esc_url

if (!has_custom_logo()) {
    ?>
		                                <a class="navbar-brand" href="<?php 
    echo esc_url(home_url('/'));
    ?>
" title="<?php 
    echo esc_attr(get_bloginfo('name', 'display'));
    ?>
" rel="home">
		                                	<?php 
    bloginfo('name');
    ?>
		                                </a>
	                                <?php 
} else {
    the_custom_logo();
}
?>
<!-- end custom logo -->

                            </div>

                            <!-- The WordPress Menu goes here -->
                            <?php 
wp_nav_menu(array('theme_location' => 'primary', 'container_class' => 'collapse navbar-toggleable-xs exCollapsingNavbar col-md-9 nav-menu', 'menu_class' => 'nav navbar-nav', 'fallback_cb' => '', 'menu_id' => 'main-menu', 'walker' => new wp_bootstrap_navwalker()));
?>

                </div> <!-- .container -->

        </nav><!-- .site-navigation -->
开发者ID:InterVarsity,项目名称:chapter-project,代码行数:30,代码来源:header.php


示例19: fotografo_the_custom_logo

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


示例20: vantage_display_logo

 /**
  * Display the logo
  */
 function vantage_display_logo()
 {
     $logo = siteorigin_setting('logo_image');
     $logo = apply_filters('vantage_logo_image_id', $logo);
     if (empty($logo)) {
         if (function_exists('has_custom_logo') && has_custom_logo()) {
             the_custom_logo();
             return;
         }
         // Just display the site title
         $logo_html = '<h1 class="site-title">' . get_bloginfo('name') . '</h1>';
         $logo_html = apply_filters('vantage_logo_text', $logo_html);
     } else {
         // load the logo image
         if (is_array($logo)) {
             list($src, $height, $width) = $logo;
         } else {
             $image = wp_get_attachment_image_src($logo, 'full');
             $src = $image[0];
             $height = $image[2];
             $width = $image[1];
         }
         // Add all the logo attributes
         $logo_attributes = apply_filters('vantage_logo_image_attributes', array('src' => $src, 'class' => siteorigin_setting('logo_in_menu_constrain') ? 'logo-height-constrain' : 'logo-no-height-constrain', 'width' => round($width), 'height' => round($height), 'alt' => sprintf(__('%s Logo', 'vantage'), get_bloginfo('name'))));
         // Try adding the retina logo
         $retina_logo = siteorigin_setting('logo_image_retina');
         if (!empty($retina_logo)) {
             $retina_logo = apply_filters('vantage_logo_retina_image_id', $retina_logo);
             $retina_logo_image = wp_get_attachment_image_src($retina_logo, 'full');
             if (!empty($retina_logo_image[0])) {
                 $logo_attributes['srcset'] = $retina_logo_image[0] . ' 2x';
             }
         }
         if ($logo_attributes['width'] > vantage_get_site_width()) {
             // Don't let the width be more than the site width.
             $width = vantage_get_site_width();
             $logo_attributes['height'] = round($logo_attributes['height'] / ($logo_attributes['width'] / $width));
             $logo_attributes['width'] = $width;
         }
         $logo_attributes_str = array();
         if (!empty($logo_attributes)) {
             foreach ($logo_attributes as $name => $val) {
                 if (empty($val)) {
                     continue;
                 }
                 $logo_attributes_str[] = $name . '="' . esc_attr($val) . '" ';
             }
         }
         $logo_html = apply_filters('vantage_logo_image', '<img ' . implode(' ', $logo_attributes_str) . ' />');
     }
     // Echo the image
     echo apply_filters('vantage_logo_html', $logo_html);
 }
开发者ID:siteorigin,项目名称:vantage,代码行数:56,代码来源:template-tags.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP the_date函数代码示例发布时间:2022-05-23
下一篇:
PHP the_content_rss函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap