本文整理匯總了PHP中kadence_display_sidebar函數的典型用法代碼示例。如果您正苦於以下問題:PHP kadence_display_sidebar函數的具體用法?PHP kadence_display_sidebar怎麽用?PHP kadence_display_sidebar使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了kadence_display_sidebar函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: kadence_main_class
/**
* .main classes
*/
function kadence_main_class()
{
if (kadence_display_sidebar()) {
// Classes on pages with the sidebar
$class = 'col-lg-9 col-md-8';
} else {
// Classes on full width pages
$class = 'col-md-12';
}
return $class;
}
示例2: foreach
foreach ($layout as $key => $value) {
switch ($key) {
case 'block_one':
if ($show_pagetitle == false) {
?>
<div id="homeheader" class="welcomeclass">
<?php
get_template_part('templates/page', 'header');
?>
</div><!--titleclass-->
<?php
}
break;
case 'block_four':
if (is_home()) {
if (kadence_display_sidebar()) {
$display_sidebar = true;
$fullclass = '';
} else {
$display_sidebar = false;
$fullclass = 'fullwidth';
}
if (isset($virtue['home_post_summery']) and $virtue['home_post_summery'] == 'full') {
$summery = "full";
$postclass = "single-article fullpost";
} else {
$summery = "summery";
$postclass = "postlist";
}
?>
<div class="homecontent <?php
示例3: kad_blog_shortcode_function
function kad_blog_shortcode_function($atts, $content)
{
extract(shortcode_atts(array('orderby' => 'date', 'type' => 'normal', 'speed' => '7000', 'columns' => '3', 'id' => rand(10, 100), 'height' => '400', 'width' => '', 'offset' => null, 'cat' => '', 'items' => '4'), $atts));
if ($orderby == 'menu_order') {
$order = 'ASC';
} else {
$order = 'DESC';
}
if (empty($cat)) {
$cat = '';
}
if ($type == 'slider') {
ob_start();
?>
<div class="sliderclass">
<?php
if (kadence_display_sidebar()) {
if (!empty($width)) {
$slidewidth = $width;
} else {
$slidewidth = 848;
}
} else {
if (!empty($width)) {
$slidewidth = $width;
} else {
$slidewidth = 1140;
}
}
?>
<div class="flexslider kt-flexslider loading" style="max-width:<?php
echo esc_attr($slidewidth);
?>
px; margin-left: auto; margin-right:auto;" data-flex-speed="<?php
echo esc_attr($speed);
?>
" data-flex-anim-speed="400" data-flex-animation="fade" data-flex-auto="true">
<ul class="slides">
<?php
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('orderby' => $orderby, 'order' => $order, 'offset' => $offset, 'post_type' => 'post', 'category_name' => $cat, 'posts_per_page' => $items));
if ($wp_query) {
while ($wp_query->have_posts()) {
$wp_query->the_post();
global $post;
if (has_post_thumbnail($post->ID)) {
$image_url = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'full');
$thumbnailURL = $image_url[0];
$image = aq_resize($thumbnailURL, $slidewidth, $height, true);
if (empty($image)) {
$image = $thumbnailURL;
}
?>
<li>
<a href="<?php
the_permalink();
?>
">
<img src="<?php
echo esc_url($image);
?>
" alt="<?php
the_title();
?>
" />
<div class="flex-caption">
<div class="captiontitle headerfont"><?php
the_title();
?>
</div>
</div>
</a>
</li>
<?php
}
}
} else {
?>
<li class="error-not-found"><?php
_e('Sorry, no blog entries found.', 'pinnacle');
?>
</li>
<?php
}
?>
<?php
$wp_query = null;
// Reset
?>
<?php
wp_reset_query();
?>
</ul>
</div> <!--Flex Slides-->
</div> <!--Slider Class-->
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
//.........這裏部分代碼省略.........
示例4: kadence_category_layout_css
function kadence_category_layout_css()
{
global $virtue_premium;
if (kadence_display_sidebar()) {
if (isset($virtue_premium['product_shop_layout']) && $virtue_premium['product_shop_layout'] == "single") {
$columns = "s-threecolumn";
} else {
$columns = "s-threecolumn";
}
} else {
if (isset($virtue_premium['product_shop_layout']) && $virtue_premium['product_shop_layout'] == "single") {
$columns = "fourcolumn";
} else {
$columns = "fourcolumn";
}
}
return $columns;
}
示例5: kad_blog_simple_shortcode_function
function kad_blog_simple_shortcode_function($atts, $content)
{
extract(shortcode_atts(array('orderby' => 'date', 'cat' => '', 'offset' => null, 'fullpost' => false, 'items' => '8'), $atts));
if ($orderby == 'menu_order') {
$order = 'ASC';
} else {
$order = 'DESC';
}
if (empty($cat)) {
$cat = '';
}
ob_start();
?>
<?php
if (kadence_display_sidebar()) {
$display_sidebar = true;
$fullclass = '';
} else {
$display_sidebar = false;
$fullclass = 'fullwidth';
}
if ($fullpost) {
$summery = 'full';
$postclass = "single-article fullpost";
} else {
$summery = 'normal';
$postclass = 'postlist';
}
?>
<div class="<?php
echo esc_attr($postclass) . ' ' . esc_attr($fullclass);
?>
">
<?php
if (!empty($wp_query)) {
$temp = $wp_query;
}
$wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('orderby' => $orderby, 'order' => $order, 'offset' => $offset, 'category_name' => $cat, 'posts_per_page' => $items));
$count = 0;
if ($wp_query) {
while ($wp_query->have_posts()) {
$wp_query->the_post();
?>
<?php
if ($fullpost) {
if ($display_sidebar) {
get_template_part('templates/content', 'fullpost');
} else {
get_template_part('templates/content', 'fullpostfull');
}
} else {
if ($display_sidebar) {
get_template_part('templates/content', get_post_format());
} else {
get_template_part('templates/content', 'fullwidth');
}
}
}
} else {
?>
<li class="error-not-found"><?php
_e('Sorry, no blog entries found.', 'virtue');
?>
</li>
<?php
}
?>
<?php
$wp_query = null;
if (!empty($temp)) {
$wp_query = $temp;
}
// Reset
?>
<?php
wp_reset_query();
?>
</div>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
示例6: get_post_meta
<?php
global $post, $pinnacle;
if (isset($pinnacle['pinnacle_animate_in']) && $pinnacle['pinnacle_animate_in'] == 1) {
$animate = 1;
} else {
$animate = 0;
}
if (isset($pinnacle['blog_infinitescroll']) && $pinnacle['blog_infinitescroll'] == 1) {
$infinitescroll = true;
} else {
$infinitescroll = false;
}
$blog_grid_column = get_post_meta($post->ID, '_kad_blog_columns', true);
$blog_grid_fullwidth = get_post_meta($post->ID, '_kad_blog_photofullwidth', true);
if (!kadence_display_sidebar() && $blog_grid_fullwidth == 'yes') {
$blog_fullwidth = true;
} else {
$blog_fullwidth = false;
}
if (isset($pinnacle['postexcerpt_hard_crop']) && $pinnacle['postexcerpt_hard_crop'] == 1) {
$hardcrop = true;
} else {
$hardcrop = false;
}
if ($blog_fullwidth) {
if ($blog_grid_column == '2') {
$itemsize = 'tcol-sxl-3 tcol-xl-4 tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12';
$postcolumn = '2';
$image_width = 700;
$image_height = 460;