function custom_background_image() { global $post; if (is_admin()) { return; } $page_bgimg_url = ''; $options = get_option('bgimg_settings'); // if front page only if ($options['bgimg_homepage']) { // then only set if the front pgage if (is_front_page() || is_home()) { $page_bgimg_url = get_background_image(); } } else { // make the global the default $page_bgimg_url = get_background_image(); // if single and single active if (is_singular() && $options['bgimg_single']) { // check to see if the theme supports Featured Images, and one is set if (current_theme_supports('post-thumbnails') && has_post_thumbnail($post->ID)) { // specify desired image size in place of 'full' $page_bgimg = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full'); $page_bgimg_url = $page_bgimg[0]; // this returns just the URL of the image } } // get background image for a category if (is_archive() && $options['bgimg_category'] && function_exists('category_image_src')) { if (category_image_src() != '') { $page_bgimg_url = category_image_src(); } } } // write out css echo ' <style type="text/css" id="custom-background-css-override"> body.custom-background { ' . ($page_bgimg_url == '' ? 'background-image: none;' : 'background: url(' . $page_bgimg_url . ') no-repeat center center fixed;') . ($options['bgimg_fullscreen'] ? ' -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover;' : '') . '} </style>'; }
function rayaparvaz_inline_style() { $background_url = null; $page_id = get_queried_object_id(); if (is_singular()) { $background_url = get_post_meta(get_the_ID(), '_rayaparvaz_background_image', true); } elseif (is_archive() || is_tax()) { $params = array('term_id' => $page_id, 'size' => 'full'); $background_url = category_image_src($params, false); //$background_url = apply_filters( 'taxonomy-images-queried-term-image-url', '' ); } if ($background_url) { echo '<style> body{background-image : url(' . $background_url . ')}</style>'; } }
*/ get_header(); ?> <div class="container-fluid" id="grid"> <nav class="toggle-nav btn btn-lg" id="Gallery-Toggle"><i class="glyphicon glyphicon-info-sign"></i> </nav> <div class="grid"> <?php $args = array('orderby' => 'name', 'order' => 'ASC'); $categories = get_categories($args); foreach ($categories as $category) { $term_id = $category->term_id; $image = category_image_src(array('term_id' => $term_id), false); $name = $category->name; ?> <div class="block full medium-half large-one-third type-image" data-order="" data-order-medium="" data-order-large=""> <div class="block-inner "> <a href="<?php the_permalink(); ?> " class="block-content"> <div class="content-rollover no-caption"> <div class="background"> <img src="<?php echo $image;
?> </span> </a> <?php } ?> </div> <?php } else { ?> <ul class="hotel-subclass"> <?php foreach ((array) $children as $term) { $image_params = array('term_id' => $term->term_id, 'size' => 'full'); $category_image_url = category_image_src($image_params, false); $category_image_url = $category_image_url ? $category_image_url : ""; $category_url = esc_url(get_term_link($term, $term->taxonomy)); $category_url = $category_url ? $category_url : ""; ?> <li class="hotel-subcat-list"> <a href="<?php echo $category_url; ?> "> <img src="<?php echo $category_image_url; ?> " alt="<?php echo $term->name;
<?php if (is_category() || is_tag() || is_tax()) { $display = false; // Get only image url $params = array('term_id' => null, 'size' => 'banner'); $archive_banner = category_image_src($params, $display); if ($archive_banner) { echo '<div class="banner-inner"><img class="page-banner" src="' . $archive_banner . '"/></div>'; } else { ?> <div class="single-cat-title"> <section class="layout"> <h1><?php single_cat_title('', true); ?> </h1> </section> </div> <?php } ?> <?php } elseif (is_search()) { ?> <div class="single-cat-title"> <section class="layout">
<?php /* Template Name: Archive */ get_header(); ?> <?php if (function_exists('category_image_src')) { $category_image = category_image_src(array('size' => 'full'), false); } else { $category_image = ''; } ?> <div class="container-fluid" id="grid"> <div class="grid"> <div class="block full medium-half large-one-third type-image" data-order="" data-order-medium="" data-order-large=""> <div class="block-inner "> <a href="http://wearefounded.com/projects/generation/" class="block-content"> <div class="content-rollover no-caption"> <div class="background"> <?php if ($category_image) { ?>