Пример #1
1
/**
 * 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;
        }
    }
}
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 
}
Пример #3
0
    /**
     * 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 
        }
    }
Пример #4
0
/**
 * 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();
    }
}
Пример #5
0
/**
 * 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"/>');
}
Пример #6
0
    /**
     * 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 
            }
        }
    }
Пример #7
0
 /**
  * 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();
     }
 }
Пример #8
0
    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 
    }
Пример #9
0
    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 
            }
        }
    }
Пример #10
0
 /**
  * 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();
     }
 }
Пример #11
0
/**
 * 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 
    }
}
Пример #12
0
    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 
        }
    }
Пример #13
0
    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 
    }
Пример #14
0
 /**
  * @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();
 }
Пример #15
0
/**
 * Output custom logo.
 */
function wedlock_the_custom_logo()
{
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
    }
}
Пример #16
0
/**
 * 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();
    }
}
Пример #17
0
/**
 * Return early if Site Logo is not available.
 */
function ubuntugnome_the_site_logo()
{
    if (!function_exists('the_custom_logo')) {
        return;
    } else {
        the_custom_logo();
    }
}
Пример #18
0
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 -->
Пример #19
0
/**
 * Output custom logo.
 */
function fotografo_the_custom_logo()
{
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
    }
}
Пример #20
0
 /**
  * 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);
 }
Пример #21
0
    /**
     * Displays the optional custom logo.
     *
     * @since 1.8
     */
    function simple_life_the_custom_logo()
    {
        if (function_exists('the_custom_logo')) {
            the_custom_logo();
        } else {
            $site_logo = simple_life_get_option('site_logo');
            if (!empty($site_logo)) {
                ?>
				<a href="<?php 
                echo esc_url(home_url('/'));
                ?>
" class="site-logo-link">
					<img src="<?php 
                echo esc_url($site_logo);
                ?>
" alt="<?php 
                echo esc_attr(get_bloginfo('name', 'display'));
                ?>
" />
				</a>
				<?php 
            }
        }
    }
Пример #22
0
/**
 * Render the theme logo.
 */
function focus_display_logo()
{
    $logo = siteorigin_setting('general_logo');
    $retina_logo = siteorigin_setting('general_retina_logo');
    if (empty($logo)) {
        if (function_exists('has_custom_logo') && has_custom_logo()) {
            the_custom_logo();
            return;
        } else {
            // Just display the site title
            bloginfo('name');
            return;
        }
    }
    $image = wp_get_attachment_image_src($logo, 'full');
    if (siteorigin_setting('general_logo_scale')) {
        $height = min($image[2], 26);
        $width = $height / $image[1] * $image[2];
    } else {
        $height = $image[2];
        $width = $image[1];
    }
    if ($retina_logo) {
        $image_2x = wp_get_attachment_image_src($retina_logo, 'full');
        $srcset = 'srcset="' . $image[0] . ' 1x, ' . $image_2x[0] . ' 2x"';
    }
    // echo $image;
    ?>
<img src="<?php 
    echo $image[0];
    ?>
" <?php 
    echo $srcset;
    ?>
 width="<?php 
    echo round($width);
    ?>
" height="<?php 
    echo round($height);
    ?>
" /><?php 
}
Пример #23
0
/**
 * Output custom logo.
 */
function don_the_custom_logo()
{
    if (function_exists('the_custom_logo')) {
        the_custom_logo();
    }
}
Пример #24
0
 /**
  * @group custom_logo
  *
  * @since 4.5.0
  */
 function test_the_custom_logo()
 {
     $this->expectOutputString('');
     the_custom_logo();
     $this->_set_custom_logo();
     $image = wp_get_attachment_image($this->custom_logo_id, 'full', false, array('class' => 'custom-logo', 'itemprop' => 'logo'));
     $this->expectOutputString('<a href="http://' . WP_TESTS_DOMAIN . '/" class="custom-logo-link" rel="home" itemprop="url">' . $image . '</a>');
     the_custom_logo();
 }