• Witam Was, mam takie pytanie, ponieważ męcze się z tym w sumie już drugi dzień. Próbowałem wiele rzeczy ale nie mogę zmienić koloru tła na konkretnej postronie. Macie jakieś pomysły? Z góry dziękuję za pomoc ! 🙂

    <?php
    /*
    Template Name: Portfolio
    .single { background-color: black }
    .page-template-template-layout-portfolio-php .site {
    */
    ?>
    <?php get_header(); ?>
    <?php $settings = thegravity_metabox_values(’metabox_portfolio’); ?>
    <?php if ($settings[’fullwidth’]): ?>
    </div>
    <?php endif; ?>
    <?php if ($settings[’categoriesbox’]) : ?>
    <!– Indent –>
    <div class=”gap60″></div>
    <!– Filters –>
    <nav class=”filters”>
    <div class=”<?php echo $settings[’fullwidth’] ? 'row-fluid’ : 'row’ ; ?>”>
    <div class=”span12 text-center”>

    <i class=”icon-cog”></i> <?php _e(’Categories’, 'Supernova’); ?>

    </div>
    </div>
    <div class=”filters-set”>
    <?php
    // Get All Items category
    $cats = array(
    array(
    'class’ => 'current’,
    'filter’ => '*’,
    'icon’ => 'icon-cloud-download’,
    'text’ => __(’All Items’, 'Supernova’),
    ),
    );
    // Get list of user categories
    $cat_icons = get_option(’category_icons’);
    $terms = get_terms(’taxonomy_portfolio_category’);
    if ($terms && count($terms)) {
    foreach ($terms as $cat) {
    $cats[] = array(
    'class’ => ”,
    'filter’ => ’.’.$cat->slug,
    'icon’ => ($cat_icons && is_array($cat_icons) && isset($cat_icons[$cat->term_id])) ? $cat_icons[$cat->term_id] : ”,
    'text’ => $cat->name,
    );
    }
    }
    reset($cats);
    ?>
    <?php for ($i = 0; $i <= count($cats) / 4; $i++) : ?>
    <div class=”row-fluid”>
    <?php for ($j = 0; $j < 4; $j++) : ?>
    <?php if (list($key, $value) = each($cats)) : ?>
    <div class=”span3″>
    ” href=”#” data-filter=”<?php echo $value[’filter’]; ?>”><i class=”<?php echo $value[’icon’]; ?>”></i> <?php echo $value[’text’]; ?>
    </div>
    <?php endif; ?>
    <?php endfor; ?>
    </div>
    <?php endfor; ?>
    </div>
    </nav>
    <?php endif; ?>
    <!– Indent –>
    <div class=”gap60″></div>
    <?php
    $args = array(
    'post_type’ => 'portfolio’,
    'posts_per_page’ => $settings[’postcount’],
    'order’ => $settings[’postorder’],
    'offset’ => (max(1, get_query_var(’paged’)) – 1) * $settings[’postcount’],
    );
    if (is_array($settings[’categories’]) && count($settings[’categories’]) && !in_array(’-1′, $settings[’categories’])) {
    $args[’tax_query’] = array(
    'relation’ => 'OR’,
    array(
    'taxonomy’ => 'taxonomy_portfolio_category’,
    'field’ => 'slug’,
    'terms’ => $settings[’categories’],
    ),
    );
    }

    $query = new WP_Query($args);
    ?>
    <?php if ($query->have_posts()): ?>
    <!– Works –>
    <div class=”filterable-items”>
    <?php
    $html = ”;
    // Set image class
    $imageclass = 'full’;
    if (!$themeoptions[’retina’]) {
    if ($settings[’columns’] == 2) {
    $imageclass = 'portfolio_two_columns’;
    } else
    if ($settings[’columns’] == 3) {
    $imageclass = 'portfolio_three_columns’;
    } else
    if ($settings[’columns’] == 4) {
    $imageclass = 'portfolio_four_columns’;
    }
    }
    while ($query->have_posts()) {
    $query->the_post();
    // Get the list of categories for isotope
    $categories = array();
    if (has_term(”, 'taxonomy_portfolio_category’)) {
    foreach (get_the_terms(get_the_ID(), 'taxonomy_portfolio_category’) as $cat) {
    $categories[] = $cat->slug;
    }
    }
    $html .= thegravity_shortcodes_column(array(
    'type’ => '1/’.$settings[’columns’],
    'class’ => join(’ ’, $categories),
    ), thegravity_shortcodes_project($imageclass, $settings[’fullwidth’])
    );
    }
    wp_reset_postdata();
    // Set necessary attributes for fullwidth portfolio
    $attributes = array();
    if ($settings[’fullwidth’]) {
    $attributes = array(
    'class’ => 'row-fluid’,
    );
    }
    echo thegravity_shortcodes_columns($attributes, $html);
    ?>
    </div>
    <!– Indent –>
    <?php if ($query->max_num_pages > 1): ?>
    <div class=”gap20″></div>
    <!– Selector for the paged navigation –>
    <nav id=”page-nav”>
    „>
    </nav>
    <!– Load more items –>
    <?php _e(’Load more items’, 'Supernova’); ?>
    <?php if (!$settings[’fullwidth’]): ?>
    <div class=”gap40″></div>
    <?php endif; ?>
    <?php endif; ?>
    <!– Indent –>
    <?php if (!$settings[’fullwidth’]): ?>
    <div class=”gap10″></div>
    <?php endif; ?>
    <?php endif; ?>
    <?php if ($settings[’fullwidth’]): ?>
    <div>
    <?php endif; ?>
    <?php get_footer(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • Temat ‘Zmiana koloru tła w konkretnej podstronie’ jest zamknięty na nowe odpowiedzi.