本文整理汇总了PHP中themify_get函数的典型用法代码示例。如果您正苦于以下问题:PHP themify_get函数的具体用法?PHP themify_get怎么用?PHP themify_get使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了themify_get函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: is_cache_activate
/**
* Check cache is disabled or builder is active or in admin
*
* return boolean
*/
public static function is_cache_activate()
{
$active = is_user_logged_in() && current_user_can('manage_options') || themify_get('setting-page_builder_cache') || is_admin() ? true : (class_exists('Themify_Builder') ? Themify_Builder::is_front_builder_activate() : FALSE);
return apply_filters('themify_builder_is_cache_active', $active);
}
开发者ID:tchataigner,项目名称:palette,代码行数:10,代码来源:class-themify-cache.php
示例2: porto_expand_link
/**
* Add class and data attribute to portfolio section
* @param sting $link
* @return string
*/
function porto_expand_link($link)
{
global $post, $themify;
if ('yes' == $themify->portfolio_expander && 'portfolio' == get_post_type() && themify_get('external_link') == '' && themify_get('lightbox_link') == '') {
$link .= '" class="porto-expand-js" data-post-id="' . $post->ID . '" data-post-type="' . get_post_type();
}
return $link;
}
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:13,代码来源:theme-class.php
示例3: array
} else {
$num_posts = "showposts=5&";
}
if (themify_check('setting-header_slider_display') && themify_get('setting-header_slider_display') == "images") {
$options = array("one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten");
foreach ($options as $option) {
if (themify_check('setting-header_slider_images_' . $option . '_image')) {
echo "<li>";
if (themify_check('setting-header_slider_images_' . $option . '_link')) {
$title = themify_check('setting-header_slider_images_' . $option . '_title') ? '<h3 class="feature-post-title">' . themify_get('setting-header_slider_images_' . $option . '_title') . '</h3>' : '';
$link = themify_get('setting-header_slider_images_' . $option . '_link');
$image = themify_get('setting-header_slider_images_' . $option . '_image');
themify_image("src=" . $image . "&setting=header_slider&ignore=true&w=145&h=120&before=<a href='" . urlencode($link) . "' title='" . urlencode($link) . "'>&after=</a>&alt=" . urlencode($link) . "&class=feature-img");
echo $title;
} else {
$image = themify_get('setting-header_slider_images_' . $option . '_image');
themify_image("src=" . $image . "&setting=header_slider&ignore=true&w=145&h=120&alt=" . $image . "&class=feature-img");
echo $title;
}
echo "</li>";
}
}
} else {
query_posts($num_posts . $cat);
if (have_posts()) {
while (have_posts()) {
the_post();
?>
<li>
<?php
开发者ID:BGCX067,项目名称:facilware-theme-hg-to-git,代码行数:31,代码来源:header-slider.php
示例4: 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
示例5: themify_webfonts_subsets
/**
* Module to specify additional characters subsets
* @param array Themify data
* @return string Module markup
* @since 1.3.9
*/
function themify_webfonts_subsets($data = array())
{
$data = themify_get_data();
$key = 'setting-webfonts_subsets';
$subsets = themify_get($key);
return '<p>
<span class="label">' . __('Additional subsets', 'themify') . '</span> <input type="text" class="width10" name="' . $key . '" value="' . $subsets . '" /> <br />
<span class="pushlabel">
<a href="#" class="refresh-webfonts button">' . __('Refresh list', 'themify') . '</a>
<br/><small>' . __('Enter the additional character subsets you need to use from Google WebFonts separated by commas. Example: latin-ext,cyrillic', 'themify') . '</small></span>
</p>';
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:18,代码来源:themify-modules.php
示例6: get_query_var
} else {
$width = $post_image_width;
$height = $post_image_height;
}
if (get_query_var('paged')) {
$paged = get_query_var('paged');
} elseif (get_query_var('page')) {
$paged = get_query_var('page');
} else {
$paged = 1;
}
if ($post_query_category != "") {
?>
<?php
if (themify_get('section_categories') != 'yes') {
?>
<?php
$wp_query->query('cat=' . $post_query_category . '&posts_per_page=' . $posts_per_page . '&paged=' . $paged);
?>
<?php
if (have_posts()) {
?>
<!-- loops-wrapper -->
<div class="loops-wrapper <?php
echo $post_layout;
?>
">
开发者ID:BGCX067,项目名称:facilware-theme-hg-to-git,代码行数:31,代码来源:page.php
示例7: the_excerpt
?>
<?php
the_excerpt();
?>
<?php
} elseif ($display_testimonial == 'none') {
?>
<?php
} else {
?>
<?php
the_content(themify_check('setting-default_more_text') ? themify_get('setting-default_more_text') : __('More →', 'themify'));
?>
<?php
}
//display content
?>
<?php
edit_post_link(__('Edit', 'themify'), '[', ']');
?>
<p class="testimonial-author">
<?php
echo $BuilderTestimonial->author_name($post, 'yes');
?>
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:31,代码来源:template-testimonial.php
示例8: themify_framework_theme_config_add_builder
/**
* Add Builder to all themes using the themify_theme_config_setup filter.
* @param $themify_theme_config
* @return mixed
* @since 1.4.2
*/
function themify_framework_theme_config_add_builder($themify_theme_config)
{
$themify_theme_config['panel']['settings']['tab']['page_builder'] = array('title' => __('Themify Builder', 'themify'), 'id' => 'themify-builder', 'custom-module' => array(array('title' => __('Enable/Disable Themify Builder', 'themify'), 'function' => 'themify_manage_builder_active')));
if ('disable' != apply_filters('themify_enable_builder', themify_get('setting-page_builder_is_active'))) {
$themify_theme_config['panel']['settings']['tab']['page_builder']['custom-module'][] = array('title' => __('Builder Options', 'themify'), 'function' => 'themify_manage_builder');
}
return $themify_theme_config;
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:14,代码来源:themify-builder.php
示例9: get_query_var
* Creates numbered pagination or displays button for infinite scroll based on user selection
* @since 1.0.0
*/
if ('infinite' == themify_get('setting-more_posts') || '' == themify_get('setting-more_posts')) {
global $wp_query, $themify;
$total_pages = $wp_query->max_num_pages;
$current_page = get_query_var('paged') ? get_query_var('paged') : 1;
if ($total_pages > $current_page) {
if ($themify->query_category != '') {
//If it's a Query Category page, set the number of total pages
echo '<script type="text/javascript">var qp_max_pages = ' . $total_pages . '</script>';
}
echo '<p id="load-more"><a href="' . next_posts($total_pages, false) . '">' . __('Load More', 'themify') . '</a></p>';
}
} else {
if ('numbered' == themify_get('setting-entries_nav') || '' == themify_get('setting-entries_nav')) {
themify_pagenav();
} else {
?>
<div class="post-nav">
<span class="prev"><?php
next_posts_link(__('« Older Entries', 'themify'));
?>
</span>
<span class="next"><?php
previous_posts_link(__('Newer Entries »', 'themify'));
?>
</span>
</div>
<?php
}
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:31,代码来源:pagination.php
示例10: themify_shortcode_post_slider
/**
* Create a slider with posts retrieved through get_posts
* @param Object $atts
* @param String $content
* @return String
*/
function themify_shortcode_post_slider($atts, $content = null)
{
wp_enqueue_script('themify-carousel-js');
extract(shortcode_atts(array('visible' => '1', 'scroll' => '1', 'auto' => '0', 'pause_hover' => 'no', 'wrap' => 'yes', 'excerpt_length' => '20', 'speed' => 'normal', 'slider_nav' => 'yes', 'pager' => 'yes', 'limit' => '5', 'offset' => '0', 'category' => '', 'image' => 'yes', 'image_w' => '240px', 'image_h' => '180px', 'more_text' => __('More...', 'themify'), 'title' => 'yes', 'display' => 'none', 'post_meta' => 'no', 'post_date' => 'no', 'width' => '', 'height' => '', 'class' => '', 'unlink_title' => 'no', 'unlink_image' => 'no', 'image_size' => 'medium', 'post_type' => 'post', 'taxonomy' => 'category', 'order' => 'DESC', 'orderby' => 'date', 'effect' => 'scroll'), $atts, 'themify_post_slider'));
$wrapvar = 'false';
if ('yes' == $wrap) {
$wrapvar = 'true';
}
if ('0' == $auto) {
$play = 'false';
} else {
$play = 'true';
}
switch ($speed) {
case 'fast':
$speed = '.5';
break;
case 'normal':
$speed = '1';
break;
case 'slow':
$speed = '4';
break;
}
$pause_hover = $pause_hover == 'yes' ? 'true' : 'false';
$numsldr = rand(0, 10000);
$postsliderstr = '';
global $post;
$query_args = array('numberposts' => $limit, 'offset' => $offset, 'post_type' => $post_type, 'order' => $order, 'orderby' => $orderby, 'suppress_filters' => false, 'post__not_in' => array(get_the_ID()));
if ('' != $category) {
$tax_query_terms = explode(',', $category);
if (preg_match('#[a-z]#', $category)) {
$query_args['tax_query'] = array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $tax_query_terms));
} else {
$exclude = array_filter($tax_query_terms, 'themify_is_negative_number');
$query_args['tax_query'] = array('relation' => 'AND', array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_filter($tax_query_terms, 'themify_is_positive_number')), array('taxonomy' => $taxonomy, 'field' => 'id', 'terms' => array_map('themify_make_absolute_number', $exclude), 'operator' => 'NOT IN'));
}
}
$posts = get_posts($query_args);
$class .= ' effect-' . $effect;
if ($posts) {
$postsliderstr = '<!-- shortcode post_slider --> <div id="post-slider-' . esc_attr($numsldr) . '" style="width: ' . esc_attr($width) . '; height: ' . esc_attr($height) . ';" class="shortcode clearfix post-slider ' . $class . '">
<ul class="slides">';
foreach ($posts as $post) {
setup_postdata($post);
global $more;
$more = 0;
$post_class = '';
foreach (get_post_class() as $postclass) {
$post_class .= " " . $postclass;
}
//get_post_class() as $postclass
$postsliderstr .= '<li><div class="slide-wrap ' . esc_attr($post_class) . '">';
if ('yes' == $image) {
$video_url = themify_get('video_url');
if ('' != $video_url) {
$postsliderstr .= '<div class="post-video">';
global $wp_embed;
$postsliderstr .= $wp_embed->run_shortcode('[embed]' . $video_url . '[/embed]');
$postsliderstr .= '</div>';
} else {
if ('no' == $unlink_image) {
$postsliderstr .= themify_get_image(array('image_size=' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image"><a href="' . themify_get_featured_image_link() . '">', 'after' => '</a></p>'));
} else {
$postsliderstr .= themify_get_image(array('image_size' => $image_size, 'ignore' => true, 'w' => $image_w, 'h' => $image_h, 'alt' => get_the_title(), 'before' => '<p class="post-image">', 'after' => '</p>'));
}
}
}
//'yes' == $image
if ('yes' == $title) {
if ('no' == $unlink_title) {
$postsliderstr .= '<h3 class="post-title"><a href="' . themify_get_featured_image_link() . '">' . get_the_title() . '</a></h3>';
} else {
$postsliderstr .= '<h3 class="post-title">' . get_the_title() . '</h3>';
}
}
//$title == "yes"
if ($post_date == "yes") {
$postsliderstr .= '<p class="post-date">' . get_the_date() . '</p>';
}
//$post_date == "yes"
if ('yes' == $post_meta) {
$postsliderstr .= '<p class="post-meta">
<span class="post-author">' . get_the_author() . '</span>
<span class="post-category">' . get_the_category_list(', ') . '</span>';
if (comments_open()) {
ob_start();
comments_popup_link('0', '1', '%', 'comments-link', '');
$write_comments = ob_get_contents();
ob_clean();
} else {
$write_comments = '';
}
$postsliderstr .= '<span class="post-comment">' . $write_comments . '</span>';
//.........这里部分代码省略.........
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:101,代码来源:themify-shortcodes.php
示例11: get_bggallery_order
function get_bggallery_order()
{
$sc_order = false;
if (themify_is_woocommerce_active() && is_shop()) {
$gallery_raw = get_post_meta(get_option('woocommerce_shop_page_id'), 'background_gallery', true);
} else {
$gallery_raw = themify_get('background_gallery');
}
if (strpos($gallery_raw, 'orderby') !== false) {
$sc_order = preg_replace('#\\[gallery(.*)orderby="([a-zA-Z0-9]*)"(.*)\\]#i', '$2', $gallery_raw);
}
return $sc_order ? $sc_order : 'post__in';
}
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:13,代码来源:theme-functions.php
示例12: themify_img_settings
function themify_img_settings($data = array())
{
/*** Img.php Crop Option Array ***/
$options = array(array("value" => "c", "name" => __('Center', 'themify')), array("value" => "t", "name" => __('Top', 'themify')), array("value" => "tr", "name" => __('Top Right', 'themify')), array("value" => "tl", "name" => __('Top Left', 'themify')), array("value" => "b", "name" => __('Bottom', 'themify')), array("value" => "br", "name" => __('Bottom Right', 'themify')), array("value" => "bl", "name" => __('Bottom Left', 'themify')), array("value" => "l", "name" => __('Left', 'themify')), array("value" => "r", "name" => __('Right', 'themify')));
$options_vertical = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
$feature_sizes = array(array('value' => 'blank', 'name' => ''), array('value' => 'thumbnail', 'name' => __('Thumbnail', 'themify')), array('value' => 'medium', 'name' => __('Medium', 'themify')), array('value' => 'large', 'name' => __('Large', 'themify')), array('value' => 'full', 'name' => __('Original Image', 'themify')));
if (themify_check('setting-img_settings_use')) {
$checked_use = "checked='checked'";
}
if (themify_check('setting-img_settings_legacy')) {
$checked_legacy = "checked='checked'";
}
$output = '<div class="module">
<div class="label">img.php</div>
<div class="row">
<input type="checkbox" class="disable_img_php" name="setting-img_settings_use" ' . $checked_use . '/> ' . __('Disable img.php globally', 'themify') . '<br/>
<small>' . __('(WordPress Featured Image or original images will be used)', 'themify') . '</small>
<br/>
</div>
<!-- BEGIN Show if img.php is enabled -->
<div class="show_if_enabled_img_php">
<div class="label">' . __('Image Quality', 'themify') . '</div>
<div class="row">
<input class="width2" type="text" name="setting-img_settings_quality" value="' . themify_get('setting-img_settings_quality') . '"> <small>' . __('max 100 (higher = better quality, but bigger file size)', 'themify') . '</small>
</div>
<div class="label">' . __('Cropping Alignment', 'themify') . '</div>
<div class="row">
<select name="setting-img_settings_crop_option"><option></option>';
foreach ($options as $option) {
if ($option['value'] == themify_get('setting-img_settings_crop_option')) {
$output .= '<option value="' . $option['value'] . '" selected="selected">' . $option['name'] . '</option>';
} else {
$output .= '<option value="' . $option['value'] . '">' . $option['name'] . '</option>';
}
}
$output .= '</select></div>
<div class="label">' . __('Vertical Cropping', 'themify') . '</div>
<div class="row">
<select name="setting-img_settings_vertical_crop_option">';
foreach ($options_vertical as $option_vertical) {
if ($option_vertical['value'] == themify_get('setting-img_settings_vertical_crop_option')) {
$output .= '<option value="' . $option_vertical['value'] . '" selected="selected">' . $option_vertical['name'] . '</option>';
} else {
$output .= '<option value="' . $option_vertical['value'] . '">' . $option_vertical['name'] . '</option>';
}
}
$output .= '</select> <small>' . __('(Select \'no\' to disable vertical cropping globally)', 'themify') . '</small></div>
</div>
<!-- END Show if img.php is enabled -->
</div>';
return $output;
}
开发者ID:rinodung,项目名称:live-theme,代码行数:55,代码来源:themify-modules.php
示例13: themify_transition_effect
/**
* Add transition effect
* FlyIn/FadeIn/disabled
* @return string
*/
function themify_transition_effect()
{
$data = themify_get_data();
$prefix = 'setting-transition_effect_';
$fadein_checked = '';
$mobile_checked = '';
$disabled_checked = '';
$mobile_options = array(array('name' => __('Off', 'themify'), 'value' => 'off'), array('name' => __('On', 'themify'), 'value' => 'on'));
if (themify_check($prefix . 'fadein')) {
$fadein_checked = "checked='checked'";
}
if (themify_check($prefix . 'mobile_exclude')) {
$mobile_checked = "checked='checked'";
}
if (themify_check($prefix . 'all_disabled')) {
$disabled_checked = "checked='checked'";
}
$output = '<p>
<span class="label" style="width:400px;">' . __('Turn off fly-in animation on mobile/tablet for better performance', 'themify') . '</span>
<select name="' . $prefix . 'mobile_exclude">';
foreach ($mobile_options as $mobile_option) {
$output .= '<option ' . selected(themify_get($prefix . 'mobile_exclude'), $mobile_option['value'], false) . ' value="' . $mobile_option['value'] . '">' . $mobile_option['name'] . '</option>';
}
$output .= ' </select>
</p>';
$output .= '<p><label for="' . $prefix . 'fadein"><input type="checkbox" id="' . $prefix . 'fadein" name="' . $prefix . 'fadein" ' . $fadein_checked . '/> ' . __('Use fade-in transition effect instead of fly-in', 'themify') . '</label></p>';
$output .= '<p><label for="' . $prefix . 'all_disabled"><input type="checkbox" id="' . $prefix . 'all_disabled" name="' . $prefix . 'all_disabled" ' . $disabled_checked . '/> ' . __('Disable all transition effect', 'themify') . '</label></p>';
return $output;
}
开发者ID:byronmisiva,项目名称:msv-dev,代码行数:34,代码来源:theme-modules.php
示例14: widget
function widget($args, $instance)
{
extract($args);
/* User-selected settings. */
$title = apply_filters('widget_title', $instance['title']);
/* Before widget (defined by themes). */
echo $before_widget;
/* Title of widget (before and after defined by themes). */
if ($title) {
echo $before_title . $title . $after_title;
}
$data = themify_get_data();
$pre = 'setting-link_';
$out = '';
$field_ids = isset($data[$pre . 'field_ids']) ? json_decode($data[$pre . 'field_ids']) : '';
if (is_array($field_ids) || is_object($field_ids)) {
$show_link_name = isset($instance['show_link_name']) && $instance['show_link_name'] ? true : false;
$open_new_window = isset($instance['open_new_window']) && $instance['open_new_window'] ? true : false;
$new_window_attr = $open_new_window ? 'target="_blank"' : '';
$icon_type = themify_check($pre . 'icon_type') ? themify_get($pre . 'icon_type') : 'image-icon';
// Icon Size
$icon_size = isset($instance['icon_size']) && '' != $instance['icon_size'] ? $instance['icon_size'] : 'icon-medium';
// Orientation
$orientation = isset($instance['orientation']) && '' != $instance['orientation'] ? $instance['orientation'] : 'horizontal';
$out .= '<ul class="social-links ' . $orientation . '">';
foreach ($field_ids as $key => $fid) {
$type_val = isset($data[$pre . 'type_' . $fid]) ? $data[$pre . 'type_' . $fid] : '';
if ($type_val != $icon_type) {
continue;
}
$title_name = $pre . 'title_' . $fid;
if (function_exists('icl_t')) {
$title_val = icl_t('Themify', $title_name, $data[$title_name]);
} else {
$title_val = isset($data[$title_name]) ? $data[$title_name] : '';
}
$link_name = $pre . 'link_' . $fid;
$link_val = isset($data[$link_name]) ? trim($data[$link_name]) : '';
if ('' == $link_val) {
continue;
}
// Image Icon
$img_name = $pre . 'img_' . $fid;
$img_val = !isset($data[$img_name]) || '' == $data[$img_name] ? '' : '<img src="' . $data[$img_name] . '" />';
// Font Icon
$font_icon = '';
if ($font_icon_class = themify_get($pre . 'ficon_' . $fid)) {
$fi_style = '';
$font_icon_class = 'fa ' . $font_icon_class;
if (stripos($font_icon_class, 'icon-') !== false) {
$font_icon_class = str_replace('icon-', 'fa-', $font_icon_class);
}
if ($font_icon_color = themify_get($pre . 'ficolor_' . $fid)) {
$fi_style .= 'color: #' . $font_icon_color . ';';
}
if ($font_icon_bgcolor = themify_get($pre . 'fibgcolor_' . $fid)) {
$fi_style .= 'background-color: #' . $font_icon_bgcolor . ';';
}
if ('' != $fi_style) {
$fi_style = 'style="' . $fi_style . '"';
}
$font_icon = '<i class="' . $font_icon_class . '" ' . $fi_style . '></i>';
}
if ('' != $link_val) {
$out .= sprintf('
<li class="social-link-item %s %s %s">
<a href="%s" title="%s" %s>%s %s %s</a>
</li>
<!-- /themify-link-item -->', sanitize_title($title_val), $icon_type, $icon_size, esc_attr($link_val), $title_val, $new_window_attr, $font_icon, $img_val, $show_link_name ? $title_val : '');
}
}
$out .= '</ul>';
}
echo $out;
/* After widget (defined by themes). */
echo $after_widget;
}
开发者ID:byronmisiva,项目名称:mrkpln-dev,代码行数:77,代码来源:themify-widgets.php
示例15: themify_get
<?php
/**
* Template to load footer widgets.
* @package themify
* @since 1.0.0
*/
$footer_widget_option = '' == themify_get('setting-footer_widgets') ? 'footerwidget-3col' : themify_get('setting-footer_widgets');
if ($footer_widget_option != 'none') {
$columns = array('footerwidget-4col' => array('col4-1', 'col4-1', 'col4-1', 'col4-1'), 'footerwidget-3col' => array('col3-1', 'col3-1', 'col3-1'), 'footerwidget-2col' => array('col4-2', 'col4-2'), 'footerwidget-1col' => array(''));
if (themify_theme_has_widgets('footer-widget-', $columns[$footer_widget_option])) {
?>
<div class="footer-widgets clearfix">
<?php
$x = 0;
foreach ($columns[$footer_widget_option] as $col) {
$x++;
$class = 1 == $x ? 'first' : '';
?>
<div class="<?php
echo esc_attr($col . ' ' . $class);
?>
">
<?php
dynamic_sidebar('footer-widget-' . $x);
?>
</div>
<?php
}
?>
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:31,代码来源:footer-widgets.php
示例16: themify_default_page_layout
/**
* Default Page Layout Module
* @param array $data Theme settings data
* @return string Markup for module.
* @since 1.0.0
*/
function themify_default_page_layout($data = array())
{
$data = themify_get_data();
/**
* Theme Settings Option Key Prefix
* @var string
*/
$prefix = 'setting-default_page_';
/**
* Sidebar placement options
* @var array
*/
$sidebar_location_options = array(array('value' => 'sidebar1', 'img' => 'images/layout-icons/sidebar1.png', 'selected' => true, 'title' => __('Sidebar Right', 'themify')), array('value' => 'sidebar1 sidebar-left', 'img' => 'images/layout-icons/sidebar1-left.png', 'title' => __('Sidebar Left', 'themify')), array('value' => 'sidebar-none', 'img' => 'images/layout-icons/sidebar-none.png', 'title' => __('No Sidebar', 'themify')));
/**
* Tertiary options <blank>|yes|no
* @var array
*/
$default_options = array(array('name' => '', 'value' => ''), array('name' => __('Yes', 'themify'), 'value' => 'yes'), array('name' => __('No', 'themify'), 'value' => 'no'));
/**
* Module markup
* @var string
*/
$output = '';
/**
* Page sidebar placement
*/
$output .= '<p>
<span class="label">' . __('Page Sidebar Option', 'themify') . '</span>';
$val = isset($data[$prefix . 'layout']) ? $data[$prefix . 'layout'] : '';
foreach ($sidebar_location_options as $option) {
if (('' == $val || !$val || !isset($val)) && (isset($option['selected']) && $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 . 'layout" class="val" value="' . $val . '" /></p>';
/**
* Hide Title in All Pages
*/
$output .= '<p>
<span class="label">' . __('Hide Title in All Pages', 'themify') . '</span>
<select name="setting-hide_page_title">' . themify_options_module($default_options, 'setting-hide_page_title') . '
</select>
</p>';
/**
* Page Comments
*/
$pre = 'setting-comments_pages';
$output .= '<p><span class="label">' . __('Page Comments', 'themify') . '</span><label for="' . $pre . '"><input type="checkbox" id="' . $pre . '" name="' . $pre . '" ' . checked(themify_get($pre), 'on', false) . ' /> ' . __('Disable comments in all Pages', 'themify') . '</label></p>';
return $output;
}
开发者ID:jhostetter,项目名称:wp_intern_themes,代码行数:62,代码来源:post-type-page.php
示例17: 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
示例18: enqueue_fonts
/**
* Enqueues Google Fonts
*
* @since 2.2.6
* @since 2.2.7 Fonts are enqueued in a single call.
*/
function enqueue_fonts()
{
$this->generate_css(true);
// Call only to enqueue fonts.
if (!empty($this->customizer_fonts)) {
$subsets = 'latin';
$user_subsets = str_replace(' ', '', themify_get('setting-webfonts_subsets'));
if (!empty($user_subsets)) {
$subsets .= ",{$user_subsets}";
}
$this->customizer_fonts = str_replace(' ', '+', implode('|', $this->customizer_fonts));
wp_enqueue_style('customizer-google-fonts' . md5($this->customizer_fonts . $subsets), themify_https_esc('http://fonts.googleapis.com/css') . '?family=' . $this->customizer_fonts . '&subset=' . $subsets);
}
}
开发者ID:rgrasiano,项目名称:viabasica-hering,代码行数:20,代码来源:class-themify-customizer.php
示例19: themify_shortcode_post_slider
|
请发表评论