예제 #1
0
/**
 * Adds custom classes to the array of body classes.
 *
 * @uses kuorinka_plus_has_site_logo
 * @return array Array of <body> classes
 */
function kuorinka_plus_logo_body_classes($classes)
{
    /* Add a class if a Site Logo is active. */
    if (kuorinka_plus_has_site_logo()) {
        $classes[] = 'has-site-logo';
    }
    return $classes;
}
예제 #2
0
function kuorinka_plus_logo_styles()
{
    /* If no logo, return. */
    if (!kuorinka_plus_has_site_logo()) {
        return;
    }
    ?>
	<style type="text/css">
	
		@media screen and (max-width: 899px) {
			
			.has-site-logo #site-title .site-title-inner {
				margin-left: auto;
				margin-right: auto;
				
			}
		
		}
	
		.has-site-logo #site-title .site-title-inner {
			display: block;
			width: <?php 
    echo kuorinka_plus_logo_dimensions();
    ?>
px;
			max-width: 100%;
			background: url(<?php 
    echo kuorinka_plus_logo();
    ?>
) no-repeat;
			background-size: contain;
			background-position: center center;
		}


		/* Retina background for logo. */
		@media screen and (-webkit-min-device-pixel-ratio: 1.3),
		screen and (min--moz-device-pixel-ratio: 1.3), 
		screen and (-o-min-device-pixel-ratio: 2 / 1),
		screen and (min-device-pixel-ratio: 1.3),
		screen and (min-resolution: 192dpi),
		screen and (min-resolution: 2dppx) {

			/* For somehow we need to put styles again, background is not enough. At least for chrome in Samsung II it didn't work. */
			.has-site-logo #site-title .site-title-inner {
				display: block;
				width: <?php 
    echo kuorinka_plus_logo_dimensions();
    ?>
px;
				max-width: 100%;
				background: url(<?php 
    echo kuorinka_plus_logo();
    ?>
) no-repeat;
				background-size: contain;
				background-position: center center;
			}

		}

		.has-site-logo #site-title .site-title-inner a {
			display: block;
			width: 100%;
			height: 0;
			padding-bottom: <?php 
    echo kuorinka_plus_logo_dimensions('ratio');
    ?>
%; /* height/width = something */	
			overflow: hidden;
			text-indent: 100%;
			white-space: nowrap;
			text-shadow: none;
			color: transparent;
		}
		
	</style>
	<?php 
}