function output_header_css() { if (get_option('k2imagerandomfeature') == '1') { $picture = K2Header::random_picture(); } else { $picture = get_option('k2header_picture'); } ?> <style type="text/css"> <?php if (!empty($picture)) { ?> #header { background: url("<?php echo get_k2info('headers_url') . $picture; ?> "); } <?php } ?> <?php if (function_exists('add_custom_image_header')) { ?> <?php if ('blank' == get_header_textcolor()) { ?> #header h1, #header .description { display: none; } <?php } else { ?> #header h1 a, #header .description { color: #<?php header_textcolor(); ?> ; } <?php } ?> <?php } ?> </style> <?php }
function init() { if (is_admin()) { add_action('admin_menu', array('K2Options', 'add_menu')); // Check for K2 uninstallation. Do here to avoid header output. if ($_GET['page'] == 'k2-options' and isset($_POST['uninstall'])) { K2::uninstall(); } // Need to check if this changes... $sidebar_manager = get_option('k2sidebarmanager'); K2Options::update(); K2Header::update(); // Ewww... if ($sidebar_manager != get_option('k2sidebarmanager')) { header('Location: themes.php?page=k2-options&updated'); exit; } } }
$style_files = K2::get_styles(); // Get the sidebar $column_number = get_option('k2columns'); $column_options = array(1 => __('Single Column', 'k2_domain'), __('Two Columns', 'k2_domain'), __('Three Columns', 'k2_domain')); // Get the asides category $asides_id = get_option('k2asidescategory'); // Get the categories we might use for asides $asides_cats = get_categories('get=all'); // Get the current K2 header picture $header_picture = get_option('k2header_picture'); $header_sizes = array(1 => __('560 x 200 px', 'k2_domain'), __('780 x 200 px', 'k2_domain'), __('950 x 200 px', 'k2_domain')); // Check that we can write to the headers folder and that it exists $is_headers_writable = is_writable(K2_HEADERS_PATH); $is_headers_dir = is_dir(K2_HEADERS_PATH); // Get the header pictures $picture_files = K2Header::get_header_images(); ?> <?php if (isset($_POST['submit']) or isset($_GET['updated'])) { ?> <div id="message2" class="updated fade"> <p><?php _e('K2 Options have been updated', 'k2_domain'); ?> </p> </div> <?php } ?>
function output_header_css() { $image_url = K2Header::get_header_image_url(); ?> <style type="text/css"> <?php if (!empty($image_url)) { ?> #header { background-image: url("<?php echo $image_url; ?> "); } <?php } ?> <?php if ('blank' == get_header_textcolor()) { ?> #header .blog-title, #header .description { position: absolute !important; left: 0px; top: -500px !important; width: 1px; height: 1px; overflow: hidden; } <?php } else { ?> #header .blog-title a, #header .description { color: #<?php header_textcolor(); ?> ; } <?php } ?> </style> <?php }
/** * Output custom header background image and text color CSS classes if set by the user. */ function output_header_css() { $image_url = K2Header::get_header_image_url(); if (get_header_textcolor() != HEADER_TEXTCOLOR || !empty($image_url)) { // Do we need to insert anything? ?> <style type="text/css"> <?php if (!empty($image_url)) { ?> #header { background-image: url("<?php echo $image_url; ?> "); } <?php } ?> <?php if ('blank' == get_header_textcolor()) { ?> #site-title, #site-description { display: none; } <?php } elseif (get_header_textcolor() != HEADER_TEXTCOLOR) { ?> #site-title a, #site-description { color: #<?php header_textcolor(); ?> ; } <?php } ?> </style> <?php } }