本文整理汇总了PHP中themify_check函数的典型用法代码示例。如果您正苦于以下问题:PHP themify_check函数的具体用法?PHP themify_check怎么用?PHP themify_check使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了themify_check函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: themify_footer_before
themify_footer_before();
//hook
?>
<footer id="footer" class="clearfix">
<?php
themify_footer_start();
//hook
?>
<?php
get_template_part('includes/footer-widgets');
?>
<div id="footer-logo">
<?php
if (themify_get('setting-footer_logo') == 'image' && themify_check('setting-footer_logo_image_value')) {
?>
<?php
echo $themify->logo_image('footer_logo');
?>
<?php
} else {
?>
<a href="<?php
echo home_url();
?>
/"><?php
bloginfo('name');
?>
</a>
<?php
开发者ID:rinodung,项目名称:live-theme,代码行数:31,代码来源:footer.php
示例2: the_content
<?php
the_content();
?>
<?php
wp_link_pages(array('before' => '<p class="post-pagination"><strong>' . __('Pages:', 'themify') . '</strong> ', 'after' => '</p>', 'next_or_number' => 'number'));
?>
<?php
edit_post_link(__('Edit', 'themify'), '[', ']');
?>
<!-- comments -->
<?php
if (!themify_check('setting-comments_pages') && $themify->query_category == "") {
?>
<?php
comments_template();
?>
<?php
}
?>
<!-- /comments -->
</div>
<!-- /.post-content -->
</div><!-- /.type-page -->
<?php
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:30,代码来源:page.php
示例3: portfolio_image
/**
* Returns the image for the portfolio slider
* @param int $attachment_id Image attachment ID
* @param int $width Width of the returned image
* @param int $height Height of the returned image
* @param string $size Size of the returned image
* @return string
* @since 1.1.0
*/
function portfolio_image($attachment_id, $width, $height, $size = 'large')
{
$size = apply_filters('themify_portfolio_image_size', $size);
if (themify_check('setting-img_settings_use')) {
// Image Script is disabled, use WP image
$html = wp_get_attachment_image($attachment_id, $size);
} else {
// Image Script is enabled, use it to process image
$img = wp_get_attachment_image_src($attachment_id, $size);
$html = themify_get_image('ignore=true&src=' . $img[0] . '&w=' . $width . '&h=' . $height);
}
return apply_filters('themify_portfolio_image_html', $html, $attachment_id, $width, $height, $size);
}
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:22,代码来源:theme-class.php
示例4: is_img_php_disabled
/**
* Check whether image script is in use or not
* @return boolean
*/
function is_img_php_disabled()
{
if (themify_check('setting-img_settings_use')) {
return true;
} else {
return false;
}
}
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:12,代码来源:class-themify-builder.php
示例5: shortcode
/**
* Main shortcode rendering
* @param array $atts
* @param $post_type
* @return string|void
*/
function shortcode($atts = array(), $post_type)
{
extract($atts);
// Pagination
global $paged;
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
// Parameters to get posts
$args = array('post_type' => $post_type, 'posts_per_page' => $limit, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false, 'paged' => $paged);
// Category parameters
$args['tax_query'] = $this->parse_category_args($category, $post_type);
// Defines layout type
$cpt_layout_class = $this->post_type . '-multiple clearfix type-multiple';
$multiple = true;
// Single post type or many single post types
if ('' != $id) {
if (strpos($id, ',')) {
$ids = explode(',', str_replace(' ', '', $id));
foreach ($ids as $string_id) {
$int_ids[] = intval($string_id);
}
$args['post__in'] = $int_ids;
$args['orderby'] = 'post__in';
} else {
$args['p'] = intval($id);
$cpt_layout_class = $this->post_type . '-single';
$multiple = false;
}
}
// Get posts according to parameters
$portfolio_query = new WP_Query();
$posts = $portfolio_query->query(apply_filters('themify_' . $post_type . '_shortcode_args', $args));
// Grid Style
if ('' == $style) {
$style = themify_check('setting-default_portfolio_index_post_layout') ? themify_get('setting-default_portfolio_index_post_layout') : 'grid4';
}
if (is_singular('portfolio')) {
if ('' == $image_w) {
$image_w = themify_check('setting-default_portfolio_single_image_post_width') ? themify_get('setting-default_portfolio_single_image_post_width') : '670';
}
if ('' == $image_h) {
$image_h = themify_check('setting-default_portfolio_single_image_post_height') ? themify_get('setting-default_portfolio_single_image_post_height') : '0';
}
if ('' == $post_date) {
$post_date = themify_check('setting-default_portfolio_single_post_date') ? themify_get('setting-default_portfolio_index_post_date') : 'yes';
}
if ('' == $title) {
$title = themify_check('setting-default_portfolio_single_title') ? themify_get('setting-default_portfolio_single_title') : 'yes';
}
if ('' == $unlink_title) {
$unlink_title = themify_check('setting-default_portfolio_single_unlink_post_title') ? themify_get('setting-default_portfolio_single_unlink_post_title') : 'no';
}
if ('' == $post_meta) {
$post_meta = themify_check('setting-default_portfolio_single_meta') ? themify_get('setting-default_portfolio_single_meta') : 'yes';
}
} else {
if ('' == $image_w) {
$image_w = themify_check('setting-default_portfolio_index_image_post_width') ? themify_get('setting-default_portfolio_index_image_post_width') : '221';
}
if ('' == $image_h) {
$image_h = themify_check('setting-default_portfolio_index_image_post_height') ? themify_get('setting-default_portfolio_index_image_post_height') : '221';
}
if ('' == $title) {
$title = themify_check('setting-default_portfolio_index_title') ? themify_get('setting-default_portfolio_index_title') : 'yes';
}
if ('' == $unlink_title) {
$unlink_title = themify_check('setting-default_portfolio_index_unlink_post_title') ? themify_get('setting-default_portfolio_index_unlink_post_title') : 'no';
}
// Reverse logic
if ('' == $post_date) {
$post_date = themify_check('setting-default_portfolio_index_post_date') ? 'no' == themify_get('setting-default_portfolio_index_post_date') ? 'yes' : 'no' : 'no';
}
if ('' == $post_meta) {
$post_meta = themify_check('setting-default_portfolio_index_post_meta_category') ? 'no' == themify_get('setting-default_portfolio_index_post_meta_category') ? 'yes' : 'no' : 'no';
}
}
// Collect markup to be returned
$out = '';
if ($posts) {
global $themify;
$themify_save = clone $themify;
// save a copy
// override $themify object
$themify->hide_title = 'yes' == $title ? 'no' : 'yes';
$themify->unlink_title = '' == $unlink_title || 'no' == $unlink_title ? 'no' : 'yes';
$themify->hide_image = 'yes' == $image ? 'no' : 'yes';
$themify->hide_meta = 'yes' == $post_meta ? 'no' : 'yes';
$themify->hide_date = 'yes' == $post_date ? 'no' : 'yes';
if (!$multiple) {
if ('' == $image_w || get_post_meta($args['p'], 'image_width', true)) {
$themify->width = get_post_meta($args['p'], 'image_width', true);
}
if ('' == $image_h || get_post_meta($args['p'], 'image_height', true)) {
$themify->height = get_post_meta($args['p'], 'image_height', true);
}
//.........这里部分代码省略.........
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:101,代码来源:post-type-portfolio.php
示例6: shortcode
function shortcode($atts = array(), $post_type)
{
extract($atts);
// Parameters to get posts
$args = array('post_type' => $post_type, 'posts_per_page' => $limit, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false);
$args['tax_query'] = $this->parse_category_args($category, $post_type);
// Defines layout type
$cpt_layout_class = $this->post_type . '-multiple clearfix type-multiple';
$multiple = true;
// Single post type or many single post types
if ('' != $id) {
if (strpos($id, ',')) {
// Multiple ////////////////////////////////////
$ids = explode(',', str_replace(' ', '', $id));
foreach ($ids as $string_id) {
$int_ids[] = intval($string_id);
}
$args['post__in'] = $int_ids;
$args['orderby'] = 'post__in';
} else {
// Single ///////////////////////////////////////
$args['p'] = intval($id);
$cpt_layout_class = $this->post_type . '-single';
$multiple = false;
}
}
// Get posts according to parameters
$posts = get_posts(apply_filters('themify_' . $post_type . '_shortcode_args', $args));
// Collect markup to be returned
$out = '';
if ($posts) {
global $themify;
// save a copy
$themify_save = clone $themify;
// override $themify object
// set image link
$themify->unlink_image = '' == $unlink_image || 'no' == $unlink_image ? 'no' : 'yes';
$themify->hide_image = 'yes' == $image ? 'no' : 'yes';
// set title link
$themify->unlink_title = '' == $unlink_title || 'no' == $unlink_title ? 'no' : 'yes';
$themify->hide_title = 'yes' == $title ? 'no' : 'yes';
if (!$multiple) {
if ('' == $image_w || get_post_meta($args['p'], 'image_width', true)) {
$themify->width = get_post_meta($args['p'], 'image_width', true);
}
if ('' == $image_h || get_post_meta($args['p'], 'image_height', true)) {
$themify->height = get_post_meta($args['p'], 'image_height', true);
}
} else {
$themify->width = $image_w;
$themify->height = $image_h;
}
$themify->use_original_dimensions = 'yes' == $use_original_dimensions ? 'yes' : 'no';
$themify->display_content = $display;
$themify->more_link = $more_link;
$themify->more_text = $more_text;
$themify->post_layout = $style;
$themify->col_class = $this->column_class($style);
if (is_singular('team')) {
$teampre = 'setting-default_team_single_';
$themify->hide_image = themify_check($teampre . 'hide_image') ? themify_get($teampre . 'hide_image') : 'no';
$themify->hide_title = themify_check($teampre . 'hide_title') ? themify_get($teampre . 'hide_title') : 'no';
$themify->unlink_image = themify_check($teampre . 'unlink_image') ? themify_get($teampre . 'unlink_image') : 'no';
$themify->unlink_title = themify_check($teampre . 'unlink_title') ? themify_get($teampre . 'unlink_title') : 'no';
$themify->width = themify_check($teampre . 'image_post_width') ? themify_get($teampre . 'image_post_width') : 144;
$themify->height = themify_check($teampre . 'image_post_height') ? themify_get($teampre . 'image_post_height') : 144;
}
$out .= '<div class="loops-wrapper shortcode ' . $post_type . ' ' . $style . ' ' . $cpt_layout_class . '">';
$out .= themify_get_shortcode_template($posts, 'includes/loop-team', 'index');
$out .= $this->section_link($more_link, $more_text, $post_type);
$out .= '</div>';
$themify = clone $themify_save;
// revert to original $themify state
}
return $out;
}
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:76,代码来源:theme-class-team.php
示例7: themify_theme_custom_post_css
/**
* Outputs custom post CSS at the end of a post
* @since 1.0.0
*/
function themify_theme_custom_post_css()
{
global $themify;
$post_id = '.section-post.post-' . get_the_ID();
$css = array();
$style = '';
if (!isset($themify->google_fonts)) {
$themify->google_fonts = '';
}
$rules = array("{$post_id}, {$post_id} h1, {$post_id} h2, {$post_id} h3, {$post_id} h4, {$post_id} h5, {$post_id} h6" => array(array('prop' => 'font-size', 'key' => array('font_size', 'font_size_unit')), array('prop' => 'font-family', 'key' => 'font_family'), array('prop' => 'color', 'key' => 'font_color')), "{$post_id} .section-title" => array(array('prop' => 'font-size', 'key' => array('title_font_size', 'font_size_unit')), array('prop' => 'font-family', 'key' => 'title_font_family'), array('prop' => 'color', 'key' => 'title_font_color')), $post_id => array(array('prop' => 'background-color', 'key' => 'background_color'), array('prop' => 'background-image', 'key' => 'background_image'), array('prop' => 'background-repeat', 'key' => 'background_repeat'), array('prop' => 'background-position', 'key' => array('background_position_x', 'background_position_y'))), "{$post_id} a" => array(array('prop' => 'color', 'key' => 'link_color')));
foreach ($rules as $selector => $property) {
foreach ($property as $val) {
$prop = $val['prop'];
$key = $val['key'];
if (is_array($key)) {
if ($prop == 'font-size' && themify_check($key[0])) {
$css[$selector][$prop] = $prop . ': ' . themify_get($key[0]) . themify_get($key[1]);
}
if ($prop == 'background-position' && themify_check($key[0])) {
$css[$selector][$prop] = $prop . ': ' . themify_get($key[0]) . ' ' . themify_get($key[1]);
}
} elseif (themify_check($key) && 'default' != themify_get($key)) {
if ($prop == 'color' || stripos($prop, 'color')) {
$css[$selector][$prop] = $prop . ': #' . themify_get($key);
} elseif ($prop == 'background-image') {
$css[$selector][$prop] = $prop . ': url(' . themify_get($key) . ')';
} elseif ($prop == 'font-family') {
$font = themify_get($key);
$css[$selector][$prop] = $prop . ': ' . $font;
if (!in_array($font, themify_get_web_safe_font_list(true))) {
$themify->google_fonts .= str_replace(' ', '+', $font . '|');
}
} else {
$css[$selector][$prop] = $prop . ': ' . themify_get($key);
}
}
}
if (!empty($css[$selector])) {
$style .= "{$selector} {\n\t" . implode(";\n\t", $css[$selector]) . "\n}\n";
}
}
if ('' != $style) {
echo "\n<!-- {$post_id} Style -->\n<style>\n{$style}</style>\n<!-- End {$post_id} Style -->\n";
}
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:49,代码来源:theme-functions.php
示例8: themify_check
<?php
/**
* Portfolio Navigation
*/
if (themify_check('setting-portfolio_nav_disable')) {
return;
}
$same_cat = themify_check('setting-portfolio_nav_same_cat') ? true : false;
$excluded_terms = array();
?>
<!-- post-nav -->
<div class="post-nav clearfix">
<?php
previous_post_link('<span class="prev">%link</span>', '<span class="arrow">' . _x('«', 'Previous entry link arrow', 'themify') . '</span> %title', $same_cat, $excluded_terms, 'portfolio-category');
?>
<?php
next_post_link('<span class="next">%link</span>', '%title <span class="arrow">»</span>', $same_cat, $excluded_terms, 'portfolio-category');
?>
</div>
<!-- /post-nav -->
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:21,代码来源:post-nav-portfolio.php
示例9: themify_get
if ($this->is_img_php_disabled()) {
$param_image .= $image_size_slider != '' ? '&image_size=' . $image_size_slider : '';
}
if (themify_get('external_link') != '') {
$ext_link = themify_get("external_link");
} elseif (themify_get('lightbox_link') != '') {
$ext_link = themify_get("lightbox_link") . '" class="lightbox" rel="prettyPhoto[slider]';
} else {
$ext_link = get_permalink();
}
if ($hide_feat_img_slider == '' || $hide_feat_img_slider == 'no') {
$post_image = themify_get_image($param_image);
if ($post_image || themify_check('video_url') == 1) {
?>
<?php
if (themify_check('video_url')) {
global $wp_embed;
$post_image = $wp_embed->run_shortcode('[embed]' . themify_get('video_url') . '[/embed]');
}
?>
<?php
themify_before_post_image();
// Hook
?>
<figure class="slide-image">
<?php
if ($unlink_feat) {
?>
<?php
echo $post_image;
?>
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:31,代码来源:template-slider-slider.php
示例10: themify_post_format_custom_fields
function themify_post_format_custom_fields($content)
{
global $post, $id, $themify_check;
if (!is_feed() || $themify_check == true) {
return $content;
}
$post_format = themify_get('post_format');
if (has_post_format('image') && themify_check('post_image')) {
$content = "<img src='" . themify_get('post_image') . "'><br>" . $content;
} elseif (has_post_format('quote') && themify_check('quote_author')) {
$content = '"' . $content . '" ' . themify_get('quote_author') . " - <a href='" . themify_get('quote_author_link') . "'>" . themify_get('quote_author_link') . "</a>";
} elseif (has_post_format('link') && themify_check('link_url')) {
$content .= "<a href='" . themify_get('link_url') . "'>" . themify_get('link_url') . "</a>";
} elseif (has_post_format('audio') && themify_check('audio_url')) {
$content = "<p><img src='" . themify_get('post_image') . "'></p><br>" . $content;
$content .= themify_get('audio_url');
} elseif (has_post_format('video') && themify_check('video_url')) {
$themify_check = true;
$content = apply_filters('the_content', themify_get('video_url')) . $content;
}
$themify_check = false;
return $content;
}
开发者ID:rinodung,项目名称:live-theme,代码行数:23,代码来源:theme-functions.php
示例11: get_post_type
<?php
/**
* Post Navigation Template
* @package themify
* @since 1.0.0
*/
$post_type = 'portfolio' == get_post_type() ? 'portfolio' : 'post';
if (!themify_check("setting-{$post_type}_nav_disable")) {
$in_same_cat = themify_check("setting-{$post_type}_nav_same_cat") ? true : false;
$this_taxonomy = 'post' == get_post_type() ? 'category' : get_post_type() . '-category';
$previous = get_previous_post_link('<span class="prev">%link</span>', '<span class="arrow"></span> %title', $in_same_cat, '', $this_taxonomy);
$next = get_next_post_link('<span class="next">%link</span>', '<span class="arrow"></span> %title', $in_same_cat, '', $this_taxonomy);
if (!empty($previous) || !empty($next)) {
?>
<div class="post-nav clearfix">
<?php
echo $previous;
?>
<?php
echo $next;
?>
</div>
<!-- /.post-nav -->
<?php
}
// empty previous or next
}
// check setting nav disable
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:31,代码来源:post-nav.php
示例12: template_redirect
function template_redirect()
{
$post_image_width = themify_get('image_width');
$post_image_height = themify_get('image_height');
if (is_singular()) {
$this->display_content = 'content';
if ('on' == themify_get('hide_header')) {
$this->hide_header = 'yes';
}
if ('on' == themify_get('hide_footer')) {
$this->hide_footer = 'yes';
}
}
if (is_page()) {
$this->page_id = get_the_ID();
$this->post_layout = themify_get('layout') != "default" && themify_check('layout') ? themify_get('layout') : themify_get('setting-default_post_layout');
// set default post layout
if ($this->post_layout == '') {
$this->post_layout = 'list-post';
}
}
///////////////////////////////////////////
// Setting image width, height
///////////////////////////////////////////
if ($this->post_layout == 'grid4') {
$this->width = self::$grid4_width;
$this->height = self::$grid4_height;
} elseif ($this->post_layout == 'grid3') {
$this->width = self::$grid3_width;
$this->height = self::$grid3_height;
} elseif ($this->post_layout == 'grid2') {
$this->width = self::$grid2_width;
$this->height = self::$grid2_height;
} elseif ($this->post_layout == 'grid2-thumb') {
$this->width = self::$grid2_thumb_width;
$this->height = self::$grid2_thumb_height;
} elseif ($this->post_layout == 'list-post') {
$this->width = self::$list_post_width;
$this->height = self::$list_post_height;
} else {
$this->width = self::$list_post_width;
$this->height = self::$list_post_height;
}
if (themify_check('setting-default_portfolio_index_disable_porto_expand') || is_singular('portfolio')) {
$this->portfolio_expander = 'no';
}
if (is_page()) {
if (get_query_var('paged')) {
$this->paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$this->paged = get_query_var('page');
} else {
$this->paged = 1;
}
global $paged;
$paged = $this->paged;
$this->layout = themify_get('page_layout') != 'default' && themify_check('page_layout') ? themify_get('page_layout') : themify_get('setting-default_page_layout');
if ($this->layout == '') {
$this->layout = 'sidebar1';
}
$this->post_layout = themify_get('layout') != 'default' && themify_check('layout') ? themify_get('layout') : themify_get('setting-default_post_layout');
if ($this->post_layout == '') {
$this->post_layout = 'list-post';
}
$this->page_title = themify_get('hide_page_title') != 'default' && themify_check('hide_page_title') ? themify_get('hide_page_title') : themify_get('setting-hide_page_title');
$this->hide_title = themify_get('hide_title');
$this->unlink_title = themify_get('unlink_title');
$this->media_position = 'default' != themify_get('media_position') && themify_check('media_position') ? themify_get('media_position') : themify_check('setting-default_media_position') ? themify_get('setting-default_media_position') : 'above';
$this->hide_image = themify_get('hide_image');
$this->unlink_image = themify_get('unlink_image');
// Post Meta Values ///////////////////////
$post_meta_keys = array('_author' => 'post_meta_author', '_category' => 'post_meta_category', '_comment' => 'post_meta_comment', '_tag' => 'post_meta_tag');
$post_meta_key = 'setting-default_';
$this->hide_meta = themify_check('hide_meta_all') ? themify_get('hide_meta_all') : themify_get($post_meta_key . 'post_meta');
foreach ($post_meta_keys as $k => $v) {
$this->{'hide_meta' . $k} = themify_check('hide_meta' . $k) ? themify_get('hide_meta' . $k) : themify_get($post_meta_key . $v);
}
// Standard fields
$this->display_content = themify_get('display_content');
$this->post_image_width = themify_get('image_width');
$this->post_image_height = themify_get('image_height');
$this->page_navigation = themify_get('hide_navigation');
// Set custom menu
$this->custom_menu = themify_get('custom_menu');
// Post query or portfolio query ///////////////////
$post_query_category = themify_get('query_category');
$portfolio_query_category = themify_get('portfolio_query_category');
$section_query_category = themify_get('section_query_category');
if ('' != $portfolio_query_category) {
$this->query_category = $portfolio_query_category;
$this->query_taxonomy = 'portfolio-category';
$this->query_post_type = 'portfolio';
if ('default' != themify_check('portfolio_hide_meta_all')) {
$this->hide_meta = themify_get('portfolio_hide_meta_all');
} else {
$this->hide_meta = themify_check('setting-default_portfolio_index_post_meta_category') ? themify_get('setting-default_portfolio_index_post_meta_category') : 'yes';
}
if ('default' != themify_get('portfolio_hide_date')) {
$this->hide_date = themify_get('portfolio_hide_date');
} else {
//.........这里部分代码省略.........
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:101,代码来源:theme-options.php
示例13: template_redirect
function template_redirect()
{
$post_image_width = themify_get('image_width');
$post_image_height = themify_get('image_height');
if (is_page()) {
$this->post_layout = themify_get('layout') != "default" && themify_check('layout') ? themify_get('layout') : themify_get('setting-default_post_layout');
// set default post layout
if ($this->post_layout == '') {
$this->post_layout = 'list-post';
}
}
///////////////////////////////////////////
// Setting image width, height
///////////////////////////////////////////
if ($this->post_layout == 'grid4') {
$this->width = self::$grid4_width;
$this->height = self::$grid4_height;
} elseif ($this->post_layout == 'grid3') {
$this->width = self::$grid3_width;
$this->height = self::$grid3_height;
} elseif ($this->post_layout == 'grid2') {
$this->width = self::$grid2_width;
$this->height = self::$grid2_height;
} elseif ($this->post_layout == 'list-large-image') {
$this->width = self::$list_large_image_width;
$this->height = self::$list_large_image_height;
} elseif ($this->post_layout == 'list-thumb-image') {
$this->width = self::$list_thumb_image_width;
$this->height = self::$list_thumb_image_height;
} elseif ($this->post_layout == 'grid2-thumb') {
$this->width = self::$grid2_thumb_width;
$this->height = self::$grid2_thumb_height;
} elseif ($this->post_layout == 'list-post') {
$this->width = self::$list_post_width;
$this->height = self::$list_post_height;
} else {
$this->width = self::$list_post_width;
$this->height = self::$list_post_height;
}
if (is_page()) {
if (get_query_var('paged')) {
$this->paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$this->paged = get_query_var('page');
} else {
$this->paged = 1;
}
$this->query_category = themify_get('query_category');
$this->layout = themify_get('page_layout') != 'default' && themify_check('page_layout') ? themify_get('page_layout') : themify_get('setting-default_page_layout');
if ($this->layout == '') {
$this->layout = 'sidebar1';
}
$this->post_layout = themify_get('layout') != 'default' && themify_check('layout') ? themify_get('layout') : themify_get('setting-default_post_layout');
if ($this->post_layout == '') {
$this->post_layout = 'list-post';
}
$this->page_title = themify_get('hide_page_title') != 'default' && themify_check('hide_page_title') ? themify_get('hide_page_title') : themify_get('setting-hide_page_title');
$this->hide_title = themify_get('hide_title');
$this->unlink_title = themify_get('unlink_title');
$this->hide_image = themify_get('hide_image');
$this->unlink_image = themify_get('unlink_image');
$this->hide_meta = themify_get('hide_meta');
$this->hide_date = themify_get('hide_date');
$this->display_content = themify_get('display_content');
$this->post_image_width = themify_get('image_width');
$this->post_image_height = themify_get('image_height');
$this->page_navigation = themify_get('hide_navigation');
$this->posts_per_page = themify_get('posts_per_page');
if ('' != $post_image_height && '' != $post_image_width) {
$this->width = $post_image_width;
$this->height = $post_image_height;
}
}
if (is_single()) {
$this->hide_title = themify_get('hide_post_title') != 'default' && themify_check('hide_post_title') ? themify_get('hide_post_title') : themify_get('setting-default_page_post_title');
$this->unlink_title = themify_get('unlink_post_title') != 'default' && themify_check('unlink_post_title') ? themify_get('unlink_post_title') : themify_get('setting-default_page_unlink_post_title');
$this->hide_date = themify_get('hide_post_date') != 'default' && themify_check('hide_post_date') ? themify_get('hide_post_date') : themify_get('setting-default_page_post_date');
$this->hide_meta = themify_get('hide_post_meta') != 'default' && themify_check('hide_post_meta') ? themify_get('hide_post_meta') : themify_get('setting-default_page_post_meta');
$this->hide_image = themify_get('hide_post_image') != 'default' && themify_check('hide_post_image') ? themify_get('hide_post_image') : themify_get('setting-default_page_post_image');
$this->unlink_image = themify_get('unlink_post_image') != 'default' && themify_check('unlink_post_image') ? themify_get('unlink_post_image') : themify_get('setting-default_page_unlink_post_image');
$this->layout = themify_get('layout') == 'sidebar-none' || themify_get('layout') == 'sidebar1' || themify_get('layout') == 'sidebar1 sidebar-left' || themify_get('layout') == 'sidebar2' ? themify_get('layout') : themify_get('setting-default_page_post_layout');
// set default layout
if ($this->layout == '') {
$this->layout = 'sidebar1';
}
$this->display_content = '';
$this->post_image_width = themify_get('image_width');
$this->post_image_height = themify_get('image_height');
// Set Default Image Sizes for Single
self::$content_width = self::$single_content_width;
self::$sidebar1_content_width = self::$single_sidebar1_content_width;
if ('' == $post_image_height && '' == $post_image_width) {
$this->width = self::$single_image_width;
$this->height = self::$single_image_height;
} else {
$this->width = $post_image_width;
$this->height = $post_image_height;
}
}
$this->height = '' == $this->height ? 0 : $this->height;
//.........这里部分代码省略.........
开发者ID:rinodung,项目名称:live-theme,代码行数:101,代码来源:theme-options.php
示例14: shortcode
/**
* Main shortcode rendering
* @param array $atts
* @param $post_type
* @return string|void
*/
function shortcode($atts = array(), $post_type)
{
extract($atts);
// Parameters to get posts
$args = array('post_type' => $post_type, 'posts_per_page' => $limit, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false);
$args['tax_query'] = $this->parse_category_args($category, $post_type);
// Defines layout type
$cpt_layout_class = $this->post_type . '-multiple clearfix type-multiple';
$multiple = true;
// Single post type or many single post types
if ('' != $id) {
if (strpos($id, ',')) {
$ids = explode(',', str_replace(' ', '', $id));
foreach ($ids as $string_id) {
$int_ids[] = intval($string_id);
}
$args['post__in'] = $int_ids;
$args['orderby'] = 'post__in';
} else {
$args['p'] = intval($id);
$cpt_layout_class = $this->post_type . '-single';
$multiple = false;
}
}
// Get posts according to parameters
$posts = get_posts(apply_filters('themify_' . $post_type . '_shortcode_args', $args));
// Collect markup to be returned
$out = '';
if ($posts) {
global $themify;
$themify_save = clone $themify;
// save a copy
// override $themify object
$themify->hide_title = $title;
$themify->hide_image = $image;
if (!$multiple) {
if ('' == $image_w || get_post_meta($args['p'], 'image_width', true)) {
$themify->width = get_post_meta($args['p'], 'image_width', true);
}
if ('' == $image_h || get_post_meta($args['p'], 'image_height', true)) {
$themify->height = get_post_meta($args['p'], 'image_height', true);
}
} else {
$themify->width = $image_w;
$themify->height = $image_h;
}
$themify->use_original_dimensions = 'yes' == $use_original_dimensions ? 'yes' : 'no';
$themify->display_content = $display;
$themify->more_link = $more_link;
$themify->more_text = $more_text;
$themify->post_layout = $style;
$slider_id = 'slider' == $style ? 'id="testimonial-slider-' . $this->instance . '"' : '';
$out .= '<div ' . $slider_id . ' class="loops-wrapper shortcode ' . $post_type . ' ' . $style . ' ' . $cpt_layout_class . '">';
if ('slider' == $style) {
$option = 'setting-testimonial_slider';
$out .= sprintf('<div class="slideshow-wrap"><ul class="slideshow" data-id="testimonial-slider-%s" data-autoplay="%s" data-effect="%s" data-speed="%s">', $this->instance, themify_check($option . '_autoplay') ? themify_get($option . '_autoplay') : '4000', themify_check($option . '_effect') ? themify_get($option . '_effect') : 'scroll', themify_check($option . '_transition_speed') ? themify_get($option . '_transition_speed') : '500');
}
$out .= themify_get_shortcode_template($posts, 'includes/loop-testimonial', 'index');
if ('slider' == $style) {
$out .= '</ul></div>';
}
$out .= $this->section_link($more_link, $more_text, $post_type);
$out .= '</div>';
$themify = clone $themify_save;
// revert to original $themify state
}
$this->instance++;
return $out;
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:75,代码来源:post-type-testimonial.php
示例15: themify_get
if (themify_get('setting-custom_feed_url') != "") {
echo themify_get('setting-custom_feed_url');
} else {
bloginfo('rss2_url');
}
?>
"></a>
</div>
<?php
}
?>
</div>
<!-- /.social-widget -->
<?php
if (!themify_check('setting-exclude_search_form')) {
?>
<?php
get_search_form();
?>
<?php
}
?>
<?php
// If there's a header background slider, show it.
global $themify_bg_gallery;
$themify_bg_gallery->create_controller();
?>
</hgroup>
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:30,代码来源:header.php
示例16: themify_default_post_layout
//.........这里部分代码省略.........
$val = themify_get($prefix . 'post_layout');
foreach ($sidebar_location_options as $option) {
if (($val == '' || !$val || !isset($val)) && $option['selected']) {
$val = $option['value'];
}
if ($val == $option['value']) {
$class = 'selected';
} else {
$class = '';
}
$output .= '<a href="#" class="preview-icon ' . $class . '" title="' . $option['title'] . '"><img src="' . THEME_URI . '/' . $option['img'] . '" alt="' . $option['value'] . '" /></a>';
}
$output .= ' <input type="hidden" name="' . $prefix . 'post_layout" class="val" value="' . $val . '" />
</p>';
/**
* Hide Post Title
*/
$output .= '<p>
<span class="label">' . __('Hide Post Title', 'themify') . '</span>
<select name="' . $prefix . 'post_title">' . themify_options_module($default_options, $prefix . 'post_title') . '
</select>
</p>';
/**
* Unlink Post Title
*/
$output .= '<p>
<span class="label">' . __('Unlink Post Title', 'themify') . '</span>
<select name="' . $prefix . 'unlink_post_title">' . themify_options_module($default_options, $prefix . 'unlink_post_title') . '
</select>
</p>';
/**
* Hide Post Meta
*/
$output .= themify_post_meta_options($prefix . 'post_meta', $data);
/**
* Hide Post Date
*/
$output .= '<p>
<span class="label">' . __('Hide Post Date', 'themify') . '</span>
<select name="' . $prefix . 'post_date">' . themify_options_module($default_options, $prefix . 'post_date') . '
</select>
</p>';
/**
* Hide Featured Image
*/
$output .= '<p>
<span class="label">' . __('Hide Featured Image', 'themify') . '</span>
<select name="' . $prefix . 'post_image">' . themify_options_module($default_options, $prefix . 'post_image') . '
</select>
</p>';
/**
* Unlink Featured Image
*/
$output .= '<p>
<span class="label">' . __('Unlink Featured Image', 'themify') . '</span>
<select name="' . $prefix . 'unlink_post_image">' . themify_options_module($default_options, $prefix . 'unlink_post_image') . '
</select>
</p>';
/**
* Featured Image Sizes
*/
$output .= themify_feature_image_sizes_select('image_post_single_feature_size');
/**
* Image dimensions
*/
$output .= '<p>
<span class="label">' . __('Image Size', 'themify') . '</span>
<input type="text" class="width2" name="setting-image_post_single_width" value="' . themify_get('setting-image_post_single_width') . '" /> ' . __('width', 'themify') . ' <small>(px)</small>
<input type="text" class="width2" name="setting-image_post_single_height" value="' . themify_get('setting-image_post_single_height') . '" /> ' . __('height', 'themify') . ' <small>(px)</small>
<br /><span class="pushlabel"><small>' . __('Enter height = 0 to disable vertical cropping with img.php enabled', 'themify') . '</small></span>
</p>';
/**
* Disable comments
*/
$pre = 'setting-comments_posts';
$comments_posts_checked = themify_check($pre) ? 'checked="checked"' : '';
$output .= '<p><span class="label">' . __('Post Comments', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . $comments_posts_checked . ' /> ' . __('Disable comments in all Posts', 'themify') . '</label></p>';
/**
* Show author box
*/
$pre = 'setting-post_author_box';
$author_box_checked = themify_check($pre) ? 'checked="checked"' : '';
$output .= '<p><span class="label">' . __('Show Author Box', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . $author_box_checked . ' /> ' . __('Show author box in all Posts', 'themify') . '</label></p>';
/**
* Remove Post Navigation
*/
$pre = 'setting-post_nav_';
$output .= '<p>
<span class="label">' . __('Post Navigation', 'themify') . '</span>
<label for="' . $pre . 'disable">
<input type="checkbox" id="' . $pre . 'disable" name="' . $pre . 'disable" ' . checked(themify_get($pre . 'disable'), 'on', false) . '/> ' . __('Remove Post Navigation', 'themify') . '
</label>
<span class="pushlabel vertical-grouped">
<label for="' . $pre . 'same_cat">
<input type="checkbox" id="' . $pre . 'same_cat" name="' . $pre . 'same_cat" ' . checked(themify_get($pre . 'same_cat'), 'on', false) . '/> ' . __('Show only posts in the same category', 'themify') . '
</label>
</span>
</p>';
return $output;
}
开发者ID:jhostetter,项目名称:wp |
请发表评论