本文整理汇总了PHP中Presscore_Config类的典型用法代码示例。如果您正苦于以下问题:PHP Presscore_Config类的具体用法?PHP Presscore_Config怎么用?PHP Presscore_Config使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Presscore_Config类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: presscore_blog_ajax_loading_responce
function presscore_blog_ajax_loading_responce($ajax_data = array())
{
global $post, $wp_query, $paged, $page;
extract($ajax_data);
if (!$nonce || !$post_id || !$post_paged || !$target_page || !wp_verify_nonce($nonce, 'presscore-posts-ajax')) {
$responce = array('success' => false, 'reason' => 'corrupted data');
} else {
require_once PRESSCORE_EXTENSIONS_DIR . '/aq_resizer.php';
require_once PRESSCORE_DIR . '/template-hooks.php';
require_once PRESSCORE_EXTENSIONS_DIR . '/dt-pagination.php';
// get page
query_posts(array('post_type' => 'page', 'page_id' => $post_id, 'post_status' => 'publish', 'page' => $target_page));
$html = '';
if (have_posts() && !post_password_required()) {
while (have_posts()) {
the_post();
// main loop
$config = Presscore_Config::get_instance();
$config->set('template', 'blog');
$config->set('layout', empty($page_data['layout']) ? 'masonry' : $page_data['layout']);
presscore_config_base_init();
presscore_react_on_categorizer();
do_action('presscore_before_loop');
ob_start();
$query = presscore_get_blog_query();
if ($query->have_posts()) {
$page_layout = presscore_get_current_layout_type();
$current_post = $posts_count;
while ($query->have_posts()) {
$query->the_post();
/*
// check if current post already loaded
$key_in_loaded = array_search( $post->ID, $loaded_items );
if ( false !== $key_in_loaded ) {
unset( $loaded_items[ $key_in_loaded ] );
continue;
}
*/
presscore_populate_post_config();
switch ($page_layout) {
case 'masonry':
presscore_get_template_part('theme', 'blog/masonry/blog-masonry-post');
break;
case 'list':
// global posts counter
$config->set('post.query.var.current_post', ++$current_post);
presscore_get_template_part('theme', 'blog/list/blog-list-post');
break;
}
}
wp_reset_postdata();
}
$html .= ob_get_clean();
}
$responce = array('success' => true);
///////////////////
// pagination //
///////////////////
$next_page_link = dt_get_next_posts_url($query->max_num_pages);
if ($next_page_link) {
$responce['nextPage'] = dt_get_paged_var() + 1;
} else {
$responce['nextPage'] = 0;
}
$load_style = $config->get('load_style');
// pagination style
if (presscore_is_load_more_pagination()) {
$pagination = dt_get_next_page_button($query->max_num_pages, 'paginator paginator-more-button with-ajax');
if ($pagination) {
$responce['currentPage'] = dt_get_paged_var();
$responce['paginationHtml'] = $pagination;
} else {
$responce['currentPage'] = $post_paged;
}
$responce['paginationType'] = 'more';
} else {
if ('ajax_pagination' == $load_style) {
ob_start();
dt_paginator($query, array('class' => 'paginator with-ajax', 'ajaxing' => true));
$pagination = ob_get_clean();
if ($pagination) {
$responce['paginationHtml'] = $pagination;
}
$responce['paginationType'] = 'paginator';
}
}
/////////////////
// response //
/////////////////
$responce['itemsToDelete'] = array_values($loaded_items);
// $responce['query'] = $page_query->query;
$responce['order'] = $query->query['order'];
$responce['orderby'] = $query->query['orderby'];
}
// main loop
$responce['html'] = $html;
}
return $responce;
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:99,代码来源:blog-helpers.php
示例2: presscore_populate_team_config
function presscore_populate_team_config($target_post_id = 0)
{
global $post;
if ($target_post_id) {
$post_id = $target_post_id;
} elseif ($post && !empty($post->ID)) {
$post_id = $post->ID;
} else {
return false;
}
$config = Presscore_Config::get_instance();
$prefix = '_dt_teammate_options_';
// open as
$open_as = get_post_meta($post_id, "{$prefix}go_to_single", true);
$config->set('post.open_as', $open_as ? 'post' : 'none');
// position
$config->set('post.member.position', get_post_meta($post_id, "{$prefix}position", true), '');
// links
$teammate_links = presscore_get_team_links_array();
$links = array();
foreach ($teammate_links as $id => $data) {
$link = get_post_meta($post_id, "{$prefix}{$id}", true);
if ($link) {
$links[$id] = $link;
}
}
$config->set('post.preview.links', $links, array());
return true;
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:29,代码来源:mod-team-template-config-helpers.php
示例3: shortcode
public function shortcode($atts, $content = null)
{
$attributes = $this->sanitize_attributes($atts);
if (presscore_vc_is_inline()) {
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => $this->taxonomy));
$dummy = '
<div class="dt_vc-shortcode_dummy dt_vc-photos_scroller" style="height: ' . $slider_args['height'] . 'px;">
<h5>Photos scroller</h5>
<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
</div>
';
return $dummy;
}
$attachments_ids = array();
// get albums
$dt_query = $this->get_posts_by_terms(array_merge($attributes, array('number' => -1)));
if ($dt_query->have_posts()) {
// take albums id
foreach ($dt_query->posts as $dt_post) {
$album_attachments = get_post_meta($dt_post->ID, '_dt_album_media_items', true);
if ($album_attachments) {
$attachments_ids = array_merge($attachments_ids, $album_attachments);
}
}
}
if ('rand' == $attributes['orderby']) {
shuffle($attachments_ids);
}
// new query to take attachments
$attachments_data = presscore_get_attachment_post_data($attachments_ids, 'post__in', 'DESC', $attributes['number']);
$config = Presscore_Config::get_instance();
$slider_class = array('shortcode-instagram');
if ('disabled' == $config->get('sidebar_position')) {
$slider_class[] = 'full';
}
$slider_style = array();
if ($attributes['margin_bottom']) {
$slider_style[] = 'margin-bottom: ' . $attributes['margin_bottom'];
}
if ($attributes['margin_top']) {
$slider_style[] = 'margin-top: ' . $attributes['margin_top'];
}
$slider_fields = array();
/*if ( $attributes['arrows'] ) {
$slider_fields[] = 'arrows';
}*/
$sharebuttons = presscore_get_share_buttons_for_prettyphoto('photo');
$slider_args = array('fields' => $slider_fields, 'class' => $slider_class, 'style' => implode(';', $slider_style), 'link' => $attributes['lightbox'] ? 'file' : 'none', 'popup' => $attributes['lightbox'] ? 'gallery' : 'none', 'container_attr' => $sharebuttons);
/*if ( $attributes['slider_title'] ) {
$slider_args['title'] = $attributes['slider_title'];
}*/
if ($attributes['height']) {
$slider_args['height'] = $attributes['height'];
}
if ($attributes['width']) {
$slider_args['img_width'] = $attributes['width'];
}
$output = presscore_get_fullwidth_slider_two($attachments_data, $slider_args);
return $output;
}
开发者ID:noman90rauf,项目名称:wp-content,代码行数:60,代码来源:small-photos.php
示例4: get_instance
public static function get_instance()
{
if (!self::$instance) {
self::$instance = new Presscore_Config();
}
return self::$instance;
}
开发者ID:noman90rauf,项目名称:wp-content,代码行数:7,代码来源:presscore-config.class.php
示例5: presscore_render_3d_slider_data
/**
* Render 3D slider.
*
*/
function presscore_render_3d_slider_data()
{
global $post;
$config = Presscore_Config::get_instance();
$slider_id = $config->get('slideshow_sliders');
$slideshows = presscore_query()->get_posts(array('post_type' => 'dt_slideshow', 'post__in' => $slider_id, 'has_password' => false));
if (!$slideshows || !$slideshows->have_posts()) {
return;
}
$slides = array();
foreach ($slideshows->posts as $slideshow) {
$media_items = get_post_meta($slideshow->ID, '_dt_slider_media_items', true);
if (empty($media_items)) {
continue;
}
$slides = array_merge($slides, $media_items);
}
$attachments_data = presscore_get_attachment_post_data($slides);
$count = count($attachments_data);
if ($count < 10) {
$chunks = array($attachments_data, array(), array());
} else {
$length = ceil($count / 3);
$chunks = array_chunk($attachments_data, $length);
}
$chunks = array_reverse($chunks);
foreach ($chunks as $layer => $images) {
printf('<div id="level%d" class="plane">' . "\n", $layer + 1);
foreach ($images as $img) {
printf('<img src="%s" alt="%s" />' . "\n", esc_url($img['full']), esc_attr($img['description']));
}
echo "</div>\n";
}
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:38,代码来源:mod-slideshow-helpers.php
示例6: presscore_footer_html_class
function presscore_footer_html_class($class = array())
{
$output = array('footer');
$config = Presscore_Config::get_instance();
switch ($config->get('template.footer.style')) {
case 'full_width_line':
$output[] = 'full-width-line';
break;
case 'solid_background':
$output[] = 'solid-bg';
break;
case 'transparent_bg_line':
$output[] = 'transparent-bg';
break;
// default - content_width_line
}
//////////////
// Output //
//////////////
if ($class && !is_array($class)) {
$class = explode(' ', $class);
}
$output = apply_filters('presscore_footer_html_class', array_merge($class, $output));
return $output ? sprintf('class="%s"', presscore_esc_implode(' ', array_unique($output))) : '';
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:25,代码来源:widget-areas.php
示例7: portfolio_slider
/**
* Portfolio slider.
*
*/
public function portfolio_slider($attributes = array())
{
$config = Presscore_Config::get_instance();
$slider_fields = array();
if ($attributes['show_title']) {
$slider_fields[] = 'title';
}
if ($attributes['meta_info']) {
$slider_fields[] = 'meta';
}
if ($attributes['show_excerpt']) {
$slider_fields[] = 'description';
}
if ($attributes['show_link']) {
$slider_fields[] = 'link';
}
if ($attributes['show_zoom']) {
$slider_fields[] = 'zoom';
}
if ($attributes['show_details']) {
$slider_fields[] = 'details';
}
$slider_style = array();
if ($attributes['margin_bottom']) {
$slider_style[] = 'margin-bottom: ' . $attributes['margin_bottom'];
}
if ($attributes['margin_top']) {
$slider_style[] = 'margin-top: ' . $attributes['margin_top'];
}
$slider_args = array('mode' => $attributes['appearance'], 'fields' => $slider_fields, 'style' => implode(';', $slider_style), 'under_image_buttons' => $attributes['under_image_buttons'], 'hover_animation' => $attributes['hover_animation'], 'hover_bg_color' => $attributes['hover_bg_color'], 'hover_content_visibility' => $attributes['hover_content_visibility']);
if ($attributes['height']) {
$slider_args['height'] = $attributes['height'];
}
if ($attributes['width']) {
$slider_args['img_width'] = $attributes['width'];
}
if (function_exists('vc_is_inline') && vc_is_inline()) {
$terms_list = presscore_get_terms_list_by_slug(array('slugs' => $attributes['category'], 'taxonomy' => 'dt_portfolio_category'));
$output = '
<div class="dt_vc-shortcode_dummy dt_vc-portfolio_scroller" style="height: ' . $slider_args['height'] . 'px;">
<h5>Portfolio scroller</h5>
<p class="text-small"><strong>Display categories:</strong> ' . $terms_list . '</p>
</div>
';
} else {
$related_posts_args = array('exclude_current' => false, 'post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category', 'field' => 'slug', 'args' => array('posts_per_page' => $attributes['number'], 'orderby' => $attributes['orderby'], 'order' => $attributes['order']));
$related_posts_args['cats'] = $attributes['category'];
if (!empty($attributes['category'])) {
$related_posts_args['select'] = 'only';
} else {
$related_posts_args['select'] = 'all';
}
$attachments_data = presscore_get_related_posts($related_posts_args);
$output = presscore_get_fullwidth_slider_two_with_hovers($attachments_data, $slider_args);
}
return $output;
}
开发者ID:proj-2014,项目名称:vlan247-test-wp,代码行数:61,代码来源:functions.php
示例8: do_header_slideshow
public function do_header_slideshow($type)
{
global $post;
$config = Presscore_Config::get_instance();
switch ($type) {
case 'porthole':
$class = 'fixed' == $config->get('slideshow_layout') ? 'class="fixed" ' : '';
$height = absint($config->get('slideshow_slider_height'));
$width = absint($config->get('slideshow_slider_width'));
if (!$height) {
$height = 500;
}
if (!$width) {
$width = 1200;
}
printf('<div id="main-slideshow" %sdata-width="%d" data-height="%d" data-autoslide="%d" data-scale="%s" data-paused="%s"></div>', $class, $width, $height, absint($config->get('slideshow_autoslide_interval')), 'fit' == $config->get('slideshow_slider_scaling') ? 'fit' : 'fill', 'paused' == $config->get('slideshow_autoplay') ? 'true' : 'false');
add_action('wp_footer', 'presscore_render_porthole_slider_data', 15);
break;
case 'photo_scroller':
$slides = array();
$slider_id = $config->get('slideshow_sliders');
$slideshow = presscore_query()->get_posts(array('post_type' => 'dt_slideshow', 'post__in' => $slider_id, 'has_password' => false));
// prepare data
if ($slideshow->have_posts()) {
while ($slideshow->have_posts()) {
$slideshow->the_post();
$media_items = get_post_meta($post->ID, '_dt_slider_media_items', true);
if (empty($media_items)) {
continue;
}
$slides = array_merge($slides, $media_items);
}
wp_reset_postdata();
}
$photo_scroller = new Presscore_PhotoScroller($slides, array('wrap_class' => 'fullscreen' == $config->get('slideshow.photo_scroller.layout') ? 'fullscreen-scroller' : '', 'background_color' => $config->get('slideshow.photo_scroller.background.color'), 'padding_top' => $config->get('slideshow.photo_scroller.padding.top'), 'padding_bottom' => $config->get('slideshow.photo_scroller.padding.bottom'), 'padding_side' => $config->get('slideshow.photo_scroller.padding.side'), 'autoplay' => 'play' == $config->get('slideshow.photo_scroller.autoplay.mode'), 'autoplay_speed' => $config->get('slideshow.photo_scroller.autoplay.speed'), 'thumbnails_visibility' => $config->get('slideshow.photo_scroller.thumbnails.visibility'), 'thumbnails_width' => $config->get('slideshow.photo_scroller.thumbnail.width'), 'thumbnails_height' => $config->get('slideshow.photo_scroller.thumbnail.height'), 'portrait_images_view' => array('max_width' => $config->get('slideshow.photo_scroller.behavior.portrait.width.max'), 'min_width' => $config->get('slideshow.photo_scroller.behavior.portrait.width.min'), 'fill_desktop' => $config->get('slideshow.photo_scroller.behavior.portrait.fill.desktop'), 'fill_mobile' => $config->get('slideshow.photo_scroller.behavior.portrait.fill.mobile')), 'landscape_images_view' => array('max_width' => $config->get('slideshow.photo_scroller.behavior.landscape.width.max'), 'min_width' => $config->get('slideshow.photo_scroller.behavior.landscape.width.min'), 'fill_desktop' => $config->get('slideshow.photo_scroller.behavior.landscape.fill.desktop'), 'fill_mobile' => $config->get('slideshow.photo_scroller.behavior.landscape.fill.mobile')), 'inactive_opacity' => $config->get('slideshow.photo_scroller.inactive.opacity'), 'show_overlay' => $config->get('slideshow.photo_scroller.overlay.enabled'), 'show_post_navigation' => false, 'show_share_buttons' => false));
if ($photo_scroller->have_slides()) {
echo $photo_scroller->get_html();
}
break;
case '3d':
$class = '';
$data_attr = '';
$slider_layout = $config->get('slideshow_3d_layout');
if (in_array($slider_layout, array('prop-fullwidth', 'prop-content-width'))) {
$class = 'prop-fullwidth' == $slider_layout ? 'class="fixed-height" ' : 'class="fixed" ';
$width = $config->get('slideshow_3d_slider_width');
$height = $config->get('slideshow_3d_slider_height');
$data_attr = sprintf(' data-width="%d" data-height="%d"', $width ? absint($width) : 2500, $height ? absint($height) : 1200);
}
printf('<div id="main-slideshow" %s><div class="three-d-slider"%s><span id="loading">0</span></div></div>', $class, $data_attr);
add_action('wp_footer', 'presscore_render_3d_slider_data', 15);
break;
}
// switch
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:55,代码来源:class-mod-slideshow-public.php
示例9: portfolio_slider
/**
* Portfolio slider.
*
*/
public function portfolio_slider($attributes = array())
{
$config = Presscore_Config::get_instance();
$related_posts_args = array('exclude_current' => false, 'post_type' => 'dt_portfolio', 'taxonomy' => 'dt_portfolio_category', 'field' => 'slug', 'args' => array('posts_per_page' => $attributes['number'], 'orderby' => $attributes['orderby'], 'order' => $attributes['order']));
if (!empty($attributes['category'])) {
$related_posts_args['cats'] = $attributes['category'];
$related_posts_args['select'] = 'only';
} else {
$related_posts_args['select'] = 'all';
}
$attachments_data = presscore_get_related_posts($related_posts_args);
$slider_class = array();
if ('disabled' == $config->get('sidebar_position')) {
$slider_class[] = 'full';
}
$slider_fields = array();
if ($attributes['show_title']) {
$slider_fields[] = 'title';
}
if ($attributes['meta_info']) {
$slider_fields[] = 'meta';
}
if ($attributes['show_excerpt']) {
$slider_fields[] = 'description';
}
if ($attributes['show_link']) {
$slider_fields[] = 'link';
}
if ($attributes['show_zoom']) {
$slider_fields[] = 'zoom';
}
if ($attributes['show_details']) {
$slider_fields[] = 'details';
}
$slider_style = array();
if ($attributes['margin_bottom']) {
$slider_style[] = 'margin-bottom: ' . $attributes['margin_bottom'];
}
if ($attributes['margin_top']) {
$slider_style[] = 'margin-top: ' . $attributes['margin_top'];
}
$slider_args = array('mode' => $attributes['appearance'], 'fields' => $slider_fields, 'class' => $slider_class, 'style' => implode(';', $slider_style), 'under_image_buttons' => $attributes['under_image_buttons'], 'hover_animation' => $attributes['hover_animation'], 'hover_bg_color' => $attributes['hover_bg_color'], 'hover_content_visibility' => $attributes['hover_content_visibility']);
if ($attributes['height']) {
$slider_args['height'] = $attributes['height'];
}
if ($attributes['width']) {
$slider_args['img_width'] = $attributes['width'];
}
$output = presscore_get_fullwidth_slider_two_with_hovers($attachments_data, $slider_args);
return $output;
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:55,代码来源:functions.php
示例10: widget
function widget($args, $instance)
{
extract($args);
$instance = wp_parse_args((array) $instance, self::$widget_defaults);
/* Our variables from the widget settings. */
$title = apply_filters('widget_title', $instance['title']);
$args = array('no_found_rows' => 1, 'posts_per_page' => $instance['show'], 'post_type' => 'dt_team', 'post_status' => 'publish', 'orderby' => $instance['orderby'], 'order' => $instance['order'], 'tax_query' => array(array('taxonomy' => 'dt_team_category', 'field' => 'term_id', 'terms' => $instance['cats'])));
switch ($instance['select']) {
case 'only':
$args['tax_query'][0]['operator'] = 'IN';
break;
case 'except':
$args['tax_query'][0]['operator'] = 'NOT IN';
break;
default:
unset($args['tax_query']);
}
$p_query = new WP_Query($args);
$autoslide = absint($instance['autoslide']);
echo $before_widget . "\n";
// title
if ($title) {
echo $before_title . $title . $after_title . "\n";
}
if ($p_query->have_posts()) {
update_post_thumbnail_cache($p_query);
echo '<ul class="team-items slider-content round-images bg-under-post rsContW"' . ($autoslide ? ' data-autoslide="' . $autoslide . '"' : '') . '>', "\n";
// get config instance
$config = Presscore_Config::get_instance();
// backup and reset config
$config_backup = $config->get();
$this->setup_config($instance);
while ($p_query->have_posts()) {
$p_query->the_post();
presscore_populate_team_config();
echo '<li>';
$this->render_teammate($instance);
echo '</li>';
}
// while have posts
wp_reset_postdata();
// restore config
$config->reset($config_backup);
echo '</ul>', "\n";
}
// if have posts
echo $after_widget . "\n";
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:48,代码来源:team.php
示例11: presscore_post_navigation
function presscore_post_navigation()
{
if (!in_the_loop()) {
return '';
}
$config = Presscore_Config::get_instance();
$output = '';
if ($config->get('post.navigation.arrows.enabled')) {
$output .= presscore_get_next_post_link('', 'prev-post', '<a class="prev-post disabled" href="javascript: void(0);"></a>');
}
if ($config->get('post.navigation.back_button.enabled')) {
$output .= presscore_get_post_back_link();
}
if ($config->get('post.navigation.arrows.enabled')) {
$output .= presscore_get_previous_post_link('', 'next-post', '<a class="next-post disabled" href="javascript: void(0);"></a>');
}
return $output;
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:18,代码来源:post-navigation.php
示例12: presscore_masonry_container_data_atts
/**
* [presscore_masonry_container_data_atts description]
*
* @since 1.0.0
*
* @return satring [description]
*/
function presscore_masonry_container_data_atts($custom_atts = array())
{
$config = Presscore_Config::get_instance();
$data_atts = array('data-padding="' . intval($config->get('item_padding')) . 'px"', 'data-cur-page="' . dt_get_paged_var() . '"');
$data_atts = array_merge($data_atts, $custom_atts);
if ($config->get('hide_last_row')) {
$data_atts[] = 'data-part-row="false"';
}
$target_height = $config->get('target_height');
if (null !== $target_height) {
$data_atts[] = 'data-target-height="' . absint($target_height) . 'px"';
}
$target_width = $config->get('post.preview.width.min');
if (null !== $target_width) {
$data_atts[] = 'data-width="' . absint($target_width) . 'px"';
}
$columns = $config->get('template.columns.number');
if (null !== $columns) {
$data_atts[] = 'data-columns="' . absint($columns) . '"';
}
return ' ' . implode(' ', $data_atts);
}
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:29,代码来源:masonry-template.php
示例13: dt_woocommerce_main_container_class_filter
/**
* Main container classes.
*
*/
function dt_woocommerce_main_container_class_filter($classes = array())
{
$config = Presscore_Config::get_instance();
switch ($config->get('sidebar_position')) {
case 'left':
$classes[] = 'sidebar-left';
break;
case 'disabled':
$classes[] = 'sidebar-none';
break;
default:
$classes[] = 'sidebar-right';
}
return $classes;
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:19,代码来源:mod-woocommerce.php
示例14: presscore_body_class
function presscore_body_class($classes)
{
$config = Presscore_Config::get_instance();
$desc_on_hoover = 'under_image' != $config->get('post.preview.description.style');
$template = $config->get('template');
$layout = $config->get('layout');
///////////////////////
// template classes //
///////////////////////
switch ($template) {
case 'blog':
$classes[] = 'blog';
break;
case 'portfolio':
$classes[] = 'portfolio';
break;
case 'team':
$classes[] = 'team';
break;
case 'testimonials':
$classes[] = 'testimonials';
break;
case 'archive':
$classes[] = 'archive';
break;
case 'search':
$classes[] = 'search';
break;
case 'albums':
$classes[] = 'albums';
break;
case 'media':
$classes[] = 'media';
break;
case 'microsite':
$classes[] = 'one-page-row';
break;
}
/////////////////////
// layout classes //
/////////////////////
switch ($layout) {
case 'masonry':
if ($desc_on_hoover) {
$classes[] = 'layout-masonry-grid';
} else {
$classes[] = 'layout-masonry';
}
break;
case 'grid':
$classes[] = 'layout-grid';
if ($desc_on_hoover) {
$classes[] = 'grid-text-hovers';
}
break;
case 'checkerboard':
case 'list':
case 'right_list':
$classes[] = 'layout-list';
break;
}
////////////////////
// hover classes //
////////////////////
if (in_array($layout, array('masonry', 'grid')) && !in_array($template, array('testimonials', 'team'))) {
$classes[] = $desc_on_hoover ? 'description-on-hover' : 'description-under-image';
}
//////////////////////////////////////
// hide dividers if content is off //
//////////////////////////////////////
if (in_array($config->get('template'), array('albums', 'portfolio')) && 'masonry' == $config->get('layout')) {
$show_dividers = $config->get('show_titles') || $config->get('show_details') || $config->get('show_excerpts') || $config->get('show_terms') || $config->get('show_links');
if (!$show_dividers) {
$classes[] = 'description-off';
}
}
/////////////////////
// single classes //
/////////////////////
if (is_single() && (post_password_required() || !comments_open() && '0' == get_comments_number())) {
$classes[] = 'no-comments';
}
////////////////////////
// header background //
////////////////////////
if (presscore_mixed_header_with_top_line()) {
$classes[] = 'header-top-line-active';
}
if (presscore_header_with_bg() && (presscore_mixed_header_with_top_line() || !presscore_header_layout_is_side())) {
switch ($config->get('header_background')) {
case 'overlap':
$classes['header_background'] = 'overlap';
break;
case 'transparent':
$classes['header_background'] = 'transparent';
if ('light' === $config->get('header.transparent.color_scheme')) {
$classes[] = 'light-preset-color';
}
break;
}
//.........这里部分代码省略.........
开发者ID:10asfar,项目名称:WordPress-the7-theme-demo-,代码行数:101,代码来源:static.php
示例15: setup_config
protected function setup_config(&$attributes)
{
$config = Presscore_Config::get_instance();
$config->set('template', 'team');
////////////////////
// Image sizing //
////////////////////
$config->set('image_layout', $attributes['images_sizing']);
$config->set('thumb_proportions', $attributes['proportion']);
$config->set('show_excerpts', $attributes['show_excerpts']);
//////////////
// Layout //
//////////////
$config->set('layout', $attributes['type']);
$config->set('full_width', $attributes['full_width']);
$config->set('post.preview.description.style', 'under_image');
$config->set('load_style', 'default');
///////////////////
// Items style //
///////////////////
$config->set('item_padding', $attributes['padding']);
$config->set('post.preview.width.min', $attributes['column_width']);
$config->set('template.columns.number', $attributes['columns']);
$config->set('post.preview.background.enabled', $attributes['members_bg']);
}
开发者ID:armslee,项目名称:wp_requid,代码行数:25,代码来源:team.php
示例16: presscore_is_load_more_pagination
/**
* Description here
*
* @since 4.3.0
* @return bool
*/
function presscore_is_load_more_pagination()
{
$config = Presscore_Config::get_instance();
return in_array($config->get('load_style'), array('ajax_more', 'lazy_loading'));
}
开发者ID:scottnkerr,项目名称:eeco,代码行数:11,代码来源:helpers.php
示例17: presscore_hover_animation_class
/**
* [presscore_hover_animation_class description]
*
* @since 1.0.0
*
* @return string [description]
*/
function presscore_hover_animation_class()
{
$config = Presscore_Config::get_instance();
switch ($config->get('post.preview.hover.animation')) {
case 'fade':
$class = 'hover-fade';
break;
case 'direction_aware':
$class = 'hover-grid';
break;
case 'scale_in':
$class = 'hover-scale';
break;
default:
$class = 'hover-fade';
}
return $class;
}
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:25,代码来源:masonry-template.php
示例18: presscore_body_class
/**
* Add theme speciffik classes to body.
*
* @since presscore 1.0
*/
function presscore_body_class( $classes ) {
global $post;
$config = Presscore_Config::get_instance();
$desc_on_hoover = ( 'under_image' != $config->get('description') );
$template = $config->get('template');
$layout = $config->get('layout');
// template classes
switch ( $template ) {
case 'blog':
$classes[] = 'blog';
if ( !of_get_option( 'general-blog_meta_postformat', 1 ) ) {
$classes[] = 'post-format-icons-disabled';
}
break;
case 'portfolio': $classes[] = 'portfolio'; break;
case 'team': $classes[] = 'team'; break;
case 'testimonials': $classes[] = 'testimonials'; break;
case 'archive': $classes[] = 'archive'; break;
case 'search': $classes[] = 'search'; break;
case 'albums': $classes[] = 'albums'; break;
case 'media': $classes[] = 'media'; break;
case 'microsite': $classes[] = 'one-page-row'; break;
}
// layout classes
switch ( $layout ) {
case 'masonry':
if ( $desc_on_hoover ) {
$classes[] = 'layout-masonry-grid';
} else {
$classes[] = 'layout-masonry';
}
break;
case 'grid':
$classes[] = 'layout-grid';
if ( $desc_on_hoover ) {
$classes[] = 'grid-text-hovers';
}
break;
case 'checkerboard':
case 'list': $classes[] = 'layout-list'; break;
}
// hover classes
if ( in_array($layout, array('masonry', 'grid')) && !in_array($template, array('testimonials', 'team')) ) {
$classes[] = $desc_on_hoover ? 'description-on-hover' : 'description-under-image';
}
// hide dividers if content is off
if ( in_array($config->get('template'), array('albums', 'portfolio')) && 'masonry' == $config->get('layout') ) {
$show_dividers = $config->get('show_titles') || $config->get('show_details') || $config->get('show_excerpts') || $config->get('show_terms') || $config->get('show_links');
if ( !$show_dividers ) $classes[] = 'description-off';
}
if ( is_single() ) {
$post_type = get_post_type();
if ( 'dt_portfolio' == $post_type && ( post_password_required() || ( !comments_open() && '0' == get_comments_number() ) ) ) {
$classes[] = 'no-comments';
} else if ( 'post' == $post_type && !of_get_option( 'general-blog_meta_postformat', 1 ) ) {
$classes[] = 'post-format-icons-disabled';
}
}
if ( in_array('single-dt_portfolio', $classes) ) {
$key = array_search('single-dt_portfolio', $classes);
$classes[ $key ] = 'single-portfolio';
}
switch ( $config->get('header_background') ) {
case 'overlap': $classes['header_background'] = 'overlap'; break;
case 'transparent': $classes['header_background'] = 'transparent';
}
if ( 'fancy' == $config->get( 'header_title' ) ) {
$classes[] = 'fancy-header-on';
} elseif ( 'slideshow' == $config->get( 'header_title' ) ) {
$classes[] = 'slideshow-on';
if ( '3d' == $config->get( 'slideshow_mode' ) && 'fullscreen-content' == $config->get( 'slideshow_3d_layout' ) ) {
$classes[] = 'threed-fullscreen';
}
if ( dt_get_paged_var() > 1 && isset($classes['header_background']) ) {
unset($classes['header_background']);
}
} elseif ( is_single() && 'disabled' == $config->get( 'header_title' ) ) {
$classes[] = 'title-off';
}
// hoover style
//.........这里部分代码省略.........
开发者ID:GitIPFire,项目名称:Homeworks,代码行数:101,代码来源:functions.php
示例19: presscore_body_class
function presscore_body_class($classes)
{
$config = Presscore_Config::get_instance();
$desc_on_hoover = 'under_image' != $config->get('post.preview.description.style');
$template = $config->get('template');
$layout = $config->get('layout');
///////////////////////
// template classes //
///////////////////////
switch ($template) {
case 'blog':
$classes[] = 'blog';
break;
case 'portfolio':
$classes[] = 'portfolio';
break;
case 'team':
$classes[] = 'team';
break;
case 'testimonials':
$classes[] = 'testimonials';
break;
case 'archive':
$classes[] = 'archive';
break;
case 'search':
$classes[] = 'search';
break;
case 'albums':
$classes[] = 'albums';
break;
case 'media':
$classes[] = 'media';
break;
case 'microsite':
$classes[] = 'one-page-row';
break;
}
/////////////////////
// layout classes //
/////////////////////
switch ($layout) {
case 'masonry':
if ($desc_on_hoover) {
$classes[] = 'layout-masonry-grid';
} else {
$classes[] = 'layout-masonry';
}
break;
case 'grid':
$classes[] = 'layout-grid';
if ($desc_on_hoover) {
$classes[] = 'grid-text-hovers';
}
break;
case 'checkerboard':
case 'list':
case 'right_list':
$classes[] = 'layout-list';
break;
}
////////////////////
// hover classes //
////////////////////
if (in_array($layout, array('masonry', 'grid')) && !in_array($t
|
请发表评论