コード例 #1
0
function bre_the_three_boxes($echo = true)
{
    ob_start();
    ?>
	<div class="home-boxes row-fluid">
		<div class="span4 box box-left">
			<div class="thumbnail box-banner">
				<?php 
    $url = get_option('bre_url_a', '');
    $image_url = get_option('bre_image_a', false);
    $label = get_option('bre_label_a', '');
    $label = bre_string('Boot Store', '3 ShortCust, label a', get_option('bre_label_a', ''));
    $description = bre_string('Boot Store', '3 ShortCust, description a', get_option('bre_description_a', ''));
    if ($image_url == false && strlen($url) + strlen($label) + strlen($description) == 0) {
        $label = ' Shortcut 1';
        $description = 'Customize these shorcuts from Appearance &gt; 3 shortcuts. You can customize title, image, text and link target. Note, you could hide them unchecking "Display 3 shortcuts"';
        $image_url = get_template_directory_uri() . '/images/shortcut1.jpg';
    } elseif ($image_url !== false) {
        $image_url = $image_url['url'];
    }
    if (strlen($image_url)) {
        ?>
					<a href="<?php 
        echo $url;
        ?>
">
					<img src="<?php 
        echo $image_url;
        ?>
" alt="<?php 
        echo $image_url;
        ?>
" />
					</a>
				<?php 
    }
    ?>
				<h3 class="entry-title"><?php 
    if (strlen($url)) {
        ?>
<a href="<?php 
        echo $url;
        ?>
"><?php 
    }
    ?>
					<span><?php 
    echo stripcslashes($label);
    ?>
</span>
				<?php 
    if (strlen($url)) {
        ?>
</a><?php 
    }
    ?>
</h3>
			</div>
			<div class="caption">
				<p><?php 
    echo stripcslashes($description);
    ?>
</p>
			</div>
			
		</div>
		<div class="span4 box box-center">
			<div class="thumbnail box-banner">
				<?php 
    $url = get_option('bre_url_b', '');
    $image_url = get_option('bre_image_b', false);
    $label = bre_string('Boot Store', '3 ShortCust, label a', get_option('bre_label_b', ''));
    $description = bre_string('Boot Store', '3 ShortCust, description a', get_option('bre_description_b', ''));
    if ($image_url == false && strlen($url) + strlen($label) + strlen($description) == 0) {
        $label = ' Shortcut 2';
        $description = 'Customize these shorcuts from Appearance &gt; 3 shortcuts. You can customize title, image, text and link target. Note, you could hide them unchecking "Display 3 shortcuts"';
        $image_url = get_template_directory_uri() . '/images/shortcut2.jpg';
    } elseif ($image_url !== false) {
        $image_url = $image_url['url'];
    }
    if (strlen($image_url)) {
        ?>
					<a href="<?php 
        echo $url;
        ?>
">
					<img src="<?php 
        echo $image_url;
        ?>
" alt="<?php 
        echo $image_url;
        ?>
" />
					</a>
				<?php 
    }
    ?>
				<h3 class="entry-title"><?php 
    if (strlen($url)) {
        ?>
<a href="<?php 
        echo $url;
        ?>
"><?php 
    }
    ?>
					<span><?php 
    echo stripcslashes($label);
    ?>
</span>
				<?php 
    if (strlen($url)) {
        ?>
</a><?php 
    }
    ?>
</h3>
			</div>
			<div class="caption">
				<p><?php 
    echo stripcslashes($description);
    ?>
</p>
			</div>
			
		</div>
		<div class="span4 box box-right">
			<div class="thumbnail box-banner">
				<?php 
    $url = get_option('bre_url_c', '');
    $image_url = get_option('bre_image_c', false);
    $label = bre_string('Boot Store', '3 ShortCust, label a', get_option('bre_label_c', ''));
    $description = bre_string('Boot Store', '3 ShortCust, description a', get_option('bre_description_c', ''));
    if ($image_url == false && strlen($url) + strlen($label) + strlen($description) == 0) {
        $label = ' Shortcut 3';
        $description = 'Customize these shorcuts from Appearance &gt; 3 shortcuts. You can customize title, image, text and link target. Note, you could hide them unchecking "Display 3 shortcuts"';
        $image_url = get_template_directory_uri() . '/images/shortcut3.jpg';
    } elseif ($image_url !== false) {
        $image_url = $image_url['url'];
    }
    if (strlen($image_url)) {
        ?>
					<a href="<?php 
        echo $url;
        ?>
">
					<img src="<?php 
        echo $image_url;
        ?>
" alt="<?php 
        echo $image_url;
        ?>
" />
					</a>
				<?php 
    }
    ?>
				<h3 class="entry-title"><?php 
    if (strlen($url)) {
        ?>
<a href="<?php 
        echo $url;
        ?>
"><?php 
    }
    ?>
					<span><?php 
    echo stripcslashes($label);
    ?>
</span>
				<?php 
    if (strlen($url)) {
        ?>
</a><?php 
    }
    ?>
</h3>
			</div>
			<div class="caption">
				<p><?php 
    echo stripcslashes($description);
    ?>
</p>
			</div>
			
		</div>
	</div><!-- .home-boxes .row-fluid-->
	<?php 
    $out = ob_get_clean();
    if ($echo) {
        echo $out;
    } else {
        return $out;
    }
}
コード例 #2
0
					<?php 
        if (is_active_sidebar('sidebar-product-tab2')) {
            ?>
					<li><a href="#product-tab2" data-toggle="tab"><?php 
            echo bre_string('Boot Store', 'Product Tabs, label two', get_option('bre_label_two'));
            ?>
</a></li>
					<?php 
        }
        ?>

					<?php 
        if (is_active_sidebar('sidebar-product-tab3')) {
            ?>
					<li><a href="#product-tab3" data-toggle="tab"><?php 
            echo bre_string('Boot Store', 'Product Tabs, label three', get_option('bre_label_three'));
            ?>
</a></li>
					<?php 
        }
        ?>

					<?php 
        // If comments are open or we have at least one comment, load up the comment template
        if (comments_open() || '0' != get_comments_number()) {
            ?>
	                  <li><a href="#product-tab-comentarios" data-toggle="tab"><?php 
            _e('Comentarios', 'boot-ecommerce');
            ?>
</a></li>
	                <?php