Ejemplo n.º 1
0
/**
 * This is a fix for when a user sets a custom background color with no custom background image.  What
 * happens is the theme's background image hides the user-selected background color.  If a user selects a
 * background image, we'll just use the WordPress custom background callback.
 *
 * @link http://core.trac.wordpress.org/ticket/16919
 */
function contango_custom_background_callback()
{
    /* Get the background image. */
    $image = get_background_image();
    /* If there's an image, just call the normal WordPress callback. We won't do anything here. */
    if (!empty($image)) {
        _custom_background_cb();
        return;
    }
    /* Get the background color. */
    $color = get_background_color();
    /* If no background color, return. */
    if (empty($color)) {
        return;
    }
    /* Use 'background' instead of 'background-color'. */
    $style = "background: #{$color};";
    ?>
<style type="text/css">body.custom-background { <?php 
    echo trim($style);
    ?>
 }</style>

<?php 
}
Ejemplo n.º 2
0
/**
 * This is a fix for when a user sets a custom background color with no custom background image. What 
 * happens is the theme's background image hides the user-selected background color.  If a user selects a 
 * background image, we'll just use the WordPress custom background callback.  This also fixes WordPress 
 * not correctly handling the theme's default background color.
 *
 * @link http://core.trac.wordpress.org/ticket/16919
 * @link http://core.trac.wordpress.org/ticket/21510
 * @author  Justin Tadlock, justintadlock.com
 * @link    http://themehybrid.com/themes/stargazer
 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function toivo_lite_custom_background_callback()
{
    /* Get the background image. */
    $image = get_background_image();
    /* If there's an image, just call the normal WordPress callback. We won't do anything here. */
    if (!empty($image)) {
        _custom_background_cb();
        return;
    }
    /* Get the background color. */
    $color = get_background_color();
    /* If no background color, return. */
    if (empty($color)) {
        return;
    }
    /* Use 'background' instead of 'background-color'. */
    $style = "background: #{$color};";
    ?>
	<style type="text/css" id="custom-background-css">body.custom-background { <?php 
    echo trim($style);
    ?>
 }</style>
	<?php 
    /* Add custom-background body class if we get this far. */
    add_filter('body_class', 'toivo_lite_add_custom_background_class');
}
Ejemplo n.º 3
0
function semifolio_custom_background_cb()
{
    // Get the background image.
    $image_bg = get_background_image();
    // If there's an image, just call the normal WordPress callback. We won't do anything here.
    if (!empty($image_bg)) {
        _custom_background_cb();
        return;
        // Get the background color.
        $color_bg = get_background_color();
        // If no background color, return.
        if (empty($color_bg)) {
            return;
        }
        // Use 'background' instead of 'background-color'.
        $style_bg = "background: {color};";
        ?>
<style type="text/css">body { <?php 
        echo trim($style_bg);
        ?>
 }</style>
	<?php 
    }
}
/**
 * This is a fix for when a user sets a custom background color with no custom background image.  What
 * happens is the theme's background image hides the user-selected background color.  If a user selects a
 * background image, we'll just use the WordPress custom background callback.  This also fixes WordPress
 * not correctly handling the theme's default background color.
 *
 * @link http://core.trac.wordpress.org/ticket/16919
 * @link http://core.trac.wordpress.org/ticket/21510
 *
 * @since  1.0.0
 * @access public
 * @return void
 */
function ubuntugnome_custom_background_callback()
{
    // Get the background image.
    $image = get_background_image();
    // If there's an image, just call the normal WordPress callback. We won't do anything here.
    if ($image) {
        _custom_background_cb();
        return;
    }
    // Get the background color.
    $color = get_background_color();
    // If no background color, return.
    if (!$color) {
        return;
    }
    // Use 'background' instead of 'background-color'.
    $style = "background: #{$color};";
    ?>
<style type="text/css" id="custom-background-css">body.custom-background { <?php 
    echo trim($style);
    ?>
 }</style>
<?php 
}
Ejemplo n.º 5
0
    /**
     * Add a wp-head callback to the custom background
     *
     * @since Cyanotype 1.0
     */
    function cyanotype_custom_background_cb()
    {
        $image = get_background_image();
        $color = get_background_color();
        if (empty($image) && empty($color)) {
            return;
        } elseif (!empty($image)) {
            _custom_background_cb();
            ?>
		<style type="text/css" id="cyanotype-custom-background-css">
			.entry-content a,
			.entry-footer .author-bio a,
			.page-content a,
			.taxonomy-description a,
			.logged-in-as a,
			.comment-content a,
			.pingback .comment-body > a,
			.textwidget a,
			.aboutme_widget a,
			.widget_gravatar a,
			.widget-grofile a,
			.image-navigation a:hover,
			.comment-navigation a:hover,
			.post-navigation a:hover .post-title,
			.entry-date a:hover,
			.entry-footer a:hover,
			.site-title a:hover,
			.entry-title a:hover,
			.comment-author a:hover,
			.comment-metadata a:hover,
			.pingback .edit-link a:hover,
			.site-info a:hover,
			#infinite-footer .blog-credits a:hover {
				text-shadow: none;
			}
		</style>

<?php 
        } elseif (!empty($color) && '001f2c' != $color) {
            ?>

		<style type="text/css" id="cyanotype-custom-background-css">
			body.custom-background,
			.site-header .sub-menu a,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus,
			#infinite-footer .container {
				background-color: #<?php 
            echo esc_attr($color);
            ?>
;
			}
			mark,
			ins,
			button:hover,
			button:focus,
			button:active,
			input[type="button"]:hover,
			input[type="button"]:focus,
			input[type="button"]:active,
			input[type="reset"]:hover,
			input[type="reset"]:focus,
			input[type="reset"]:active,
			input[type="submit"]:hover,
			input[type="submit"]:focus,
			input[type="submit"]:active,
			.site-header .nav-menu a:hover,
			.site-header .nav-menu a:focus,
			.pagination .prev:hover,
			.pagination .prev:focus,
			.pagination .next:hover,
			.pagination .next:focus,
			.widget_calendar tbody a,
			.page-links a:hover,
			.page-links a:focus,
			.comment-reply-link:hover,
			.comment-reply-link:focus,
			#infinite-handle span:hover,
			#infinite-handle span:focus {
				color: #<?php 
            echo esc_attr($color);
            ?>
;
			}

			.highlander-dark .comments-area #respond p.form-submit input#comment-submit:hover,
			.highlander-dark .comments-area #respond p.form-submit input#comment-submit:focus {
				color: #<?php 
            echo esc_attr($color);
            ?>
 !important;
			}

			@media screen and (min-width: 51.755em) {
				.post-navigation a:hover,
				.post-navigation a:focus {
					color: #<?php 
            echo esc_attr($color);
            ?>
;
				}
			}

			.entry-content a,
			.entry-footer .author-bio a,
			.page-content a,
			.taxonomy-description a,
			.logged-in-as a,
			.comment-content a,
			.pingback .comment-body > a,
			.textwidget a,
			.aboutme_widget a,
			.widget_gravatar a,
			.widget-grofile a,
			.image-navigation a:hover,
			.comment-navigation a:hover,
			.post-navigation a:hover .post-title,
			.entry-date a:hover,
			.entry-footer a:hover,
			.site-title a:hover,
			.entry-title a:hover,
			.comment-author a:hover,
			.comment-metadata a:hover,
			.pingback .edit-link a:hover,
			.site-info a:hover,
			#infinite-footer .blog-credits a:hover {
				text-shadow: 2px 0 0 #<?php 
            echo esc_attr($color);
            ?>
, -2px 0 0 #<?php 
            echo esc_attr($color);
            ?>
;
			}

			.entry-title a:hover {
				text-shadow: 2px 2px 0 #<?php 
            echo esc_attr($color);
            ?>
, -2px 2px 0 #<?php 
            echo esc_attr($color);
            ?>
;
			}
		</style>
<?php 
        }
    }
Ejemplo n.º 6
0
    /**
     * Add a wp-head callback to the custom background
     *
     * @since Afterlight 1.0
     */
    function afterlight_custom_background_cb()
    {
        $image = get_background_image();
        $color = get_background_color();
        if (empty($image) && empty($color)) {
            return;
        }
        if (!empty($image)) {
            _custom_background_cb();
        }
        if (!empty($color) && '1a1a1a' != $color) {
            ?>
		<style type="text/css" id="afterlight-custom-background-css">
			body.custom-background,
			.widget_calendar tbody a:hover,
			.widget_calendar tbody a:focus {
				background-color: #<?php 
            echo esc_attr($color);
            ?>
;
			}
			mark,
			ins,
			button:hover,
			button:focus,
			button:active,
			input[type="button"]:hover,
			input[type="button"]:focus,
			input[type="button"]:active,
			input[type="reset"]:hover,
			input[type="reset"]:focus,
			input[type="reset"]:active,
			input[type="submit"]:hover,
			input[type="submit"]:focus,
			input[type="submit"]:active,
			.site-header .nav-menu li:hover,
			.site-header .nav-menu li:focus,
			.pagination .prev:hover,
			.pagination .prev:focus,
			.pagination .next:hover,
			.pagination .next:focus,
			.widget_calendar tbody a,
			.page-links a:hover,
			.page-links a:focus,
			.comment-reply-link:hover,
			.comment-reply-link:focus,
			#infinite-handle span:hover,
			#infinite-handle span:focus {
				color: #<?php 
            echo esc_attr($color);
            ?>
;
			}

			@media screen and (min-width: 51.755em) {
				.post-navigation a:hover,
				.post-navigation a:focus {
					color: #<?php 
            echo esc_attr($color);
            ?>
;
				}
			}
		</style>
<?php 
        }
    }
Ejemplo n.º 7
0
/**
 * @since 0.1.0
 * @deprecated 0.2.0
 */
function my_life_custom_background_callback()
{
    _deprecated_function(__FUNCTION__, '0.2.0');
    _custom_background_cb();
}
Ejemplo n.º 8
0
/**
 * Custom background header callback. Based on:
 * http://devpress.com/blog/custom-background-fix-for-theme-developers/
 * @since 1.6
 */
function ar2_custom_bg_header_callback()
{
    $image = get_background_image();
    if (!empty($image)) {
        _custom_background_cb();
        return;
    }
    $color = get_background_color();
    if (empty($color)) {
        return;
    }
    $style = "background: #{$color};";
    ?>
	<style type="text/css">
		body { 
			<?php 
    echo trim($style);
    ?>
 
		}
		#wrapper {
			box-shadow: none;
		}
	</style>
	<?php 
}
<?php 
global $wp_customize;
_custom_background_cb();
?>

<style type="text/css" media="all">


    <?php 
if ($style = get_theme_mod('top_bg1')) {
    ?>

    .navbar-default .inner{ background: transparent url("<?php 
    echo $style;
    ?>
") repeat-x center top}
    <?php 
}
?>

    <?php 
if ($style = get_theme_mod('top_bg2')) {
    ?>
    .navbar-default .inner:before{ background: transparent url("<?php 
    echo $style;
    ?>
") repeat-x center top}
    <?php 
}
?>
Ejemplo n.º 10
0
/**
 * Custom Background Callback to make the .site-logo-housing (above the menu) match
 * the chosen custom background color in body.custom-background
 * 
 * @link http://wordpress.stackexchange.com/questions/189361/add-custom-background-to-div-in-home-page
 */
function jkl_custom_background_cb()
{
    ob_start();
    _custom_background_cb();
    // Default handler
    $style = ob_get_clean();
    $style = str_replace('body.custom-background', 'body.custom-background, .site-logo-housing, .site-logo', $style);
    echo $style;
}
Ejemplo n.º 11
0
/**
 * Custom Background callback
 *
 * @since Cakifo 1.3
 * @deprecated Cakifo 1.4
 */
function cakifo_custom_background_callback()
{
    _deprecated_function(__FUNCTION__, '1.4');
    _custom_background_cb();
    return;
}