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
<?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 }
/** * 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); }
/** * 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; } }
/** * 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); } } 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->portfolio_instance = $this->instance; $out .= '<div class="loops-wrapper shortcode ' . $post_type . ' ' . $style . ' ' . $cpt_layout_class . '">'; $out .= themify_get_shortcode_template($posts, 'includes/loop-portfolio', 'index'); $out .= $this->section_link($more_link, $more_text, $post_type); $out .= '</div>'; $themify = clone $themify_save; // revert to original $themify state } return $out; }
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; }
/** * 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"; } }
<?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 -->
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; ?>
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; }
<?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
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 { $this->hide_date = themify_check('setting-default_portfolio_index_post_date') ? themify_get('setting-default_portfolio_index_post_date') : 'yes'; } $this->post_layout = themify_get('portfolio_layout') ? themify_get('portfolio_layout') : themify_get('setting-default_portfolio_index_post_layout'); if ('' == $this->post_layout) { $this->post_layout = 'list-post'; } $this->hide_title = themify_get('portfolio_hide_title'); $this->unlink_title = themify_get('portfolio_unlink_title'); $this->hide_image = themify_get('portfolio_hide_image'); $this->unlink_image = themify_get('portfolio_unlink_image'); $this->display_content = themify_get('portfolio_display_content'); $this->post_image_width = themify_get('portfolio_image_width'); $this->post_image_height = themify_get('portfolio_image_height'); $this->page_navigation = themify_get('portfolio_hide_navigation'); $this->posts_per_page = themify_get('portfolio_posts_per_page'); $this->order = themify_get('portfolio_order'); $this->orderby = themify_get('portfolio_orderby'); if ('' != themify_get('portfolio_image_width')) { $this->width = themify_get('portfolio_image_width'); } else { $this->width = themify_check('setting-default_portfolio_index_image_post_width') ? themify_get('setting-default_portfolio_index_image_post_width') : self::$index_portfolio_image_width; } if ('' != themify_get('portfolio_image_height')) { $this->height = themify_get('portfolio_image_height'); } else { $this->height = themify_check('setting-default_portfolio_index_image_post_height') ? themify_get('setting-default_portfolio_index_image_post_height') : self::$index_portfolio_image_height; } $this->feature = 'gallery' == themify_get('portfolio_feature') ? 'gallery' : 'image'; $this->portfolio_expander = themify_get('portfolio_expander'); } elseif ('' != $section_query_category) { $this->query_category = $section_query_category; $this->query_taxonomy = 'section-category'; $this->query_post_type = 'section'; $this->hide_title = themify_get('section_hide_title'); $this->hide_subtitle = themify_get('section_hide_subtitle'); $this->posts_per_page = themify_get('section_posts_per_page'); $this->order = themify_get('section_order'); $this->orderby = themify_get('section_orderby'); $this->post_layout = 'list-post'; } else { $this->query_category = $post_query_category; $this->query_taxonomy = 'category'; $this->query_post_type = 'post'; if (themify_check('posts_per_page')) { $this->posts_per_page = themify_get('posts_per_page'); } $this->order = themify_get('order') && '' != themify_get('order') ? themify_get('order') : (themify_check('setting-index_order') ? themify_get('setting-index_order') : 'DESC'); $this->orderby = themify_get('orderby') && '' != themify_get('orderby') ? themify_get('orderby') : (themify_check('setting-index_orderby') ? themify_get('setting-index_orderby') : 'date'); if ('default' != themify_get('hide_date')) { $this->hide_date = themify_get('hide_date'); } else { $this->hide_date = themify_check('setting-default_post_date') ? themify_get('setting-default_post_date') : 'no'; } } if ('' != $post_image_height && '' != $post_image_width) { $this->width = $post_image_width; $this->height = $post_image_height; } } if (is_tax('portfolio-category') && !is_page()) { $this->post_layout = themify_check('setting-default_portfolio_index_post_layout') ? themify_get('setting-default_portfolio_index_post_layout') : 'list-post'; $this->layout = themify_check('setting-default_portfolio_index_layout') ? themify_get('setting-default_portfolio_index_layout') : 'sidebar-none'; $this->hide_meta = themify_check('setting-default_portfolio_index_post_meta_category') ? themify_get('setting-default_portfolio_index_post_meta_category') : 'yes'; $this->hide_date = themify_check('setting-default_portfolio_index_post_date') ? themify_get('setting-default_portfolio_index_post_date') : 'yes'; $this->width = themify_check('setting-default_portfolio_index_image_post_width') ? themify_get('setting-default_portfolio_index_image_post_width') : self::$index_portfolio_image_width; $this->height = themify_get('setting-default_portfolio_index_image_post_height') ? themify_get('setting-default_portfolio_index_image_post_height') : self::$index_portfolio_image_height; } if (is_tax('section-category') && !is_page()) { $this->post_layout = themify_check('setting-default_section_index_post_layout') ? themify_get('setting-default_section_index_post_layout') : 'list-post'; $this->layout = themify_check('setting-default_section_index_layout') ? themify_get('setting-default_section_index_layout') : 'sidebar-none'; $this->hide_meta = themify_check('setting-default_section_index_post_meta_category') ? themify_get('setting-default_section_index_post_meta_category') : 'yes'; $this->hide_date = themify_check('setting-default_section_index_post_date') ? themify_get('setting-default_section_index_post_date') : 'yes'; } if (is_singular('post') || is_singular('portfolio')) { $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->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->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'); // Media Position $this->media_position = themify_check('media_position') ? themify_get('media_position') : 'default'; //themify_get('media_position') : (false) ? 'default1' : 'default2';//themify_check('setting-default_page_post_media_position') ? themify_get('setting-default_page_post_media_position') : 'above'; if ($this->media_position == 'default') { $this->media_position = themify_check('setting-default_page_post_media_position') ? themify_get('setting-default_page_post_media_position') : 'above'; } if (is_singular('post')) { // set default layout if (themify_get('layout') == 'sidebar-none' || themify_get('layout') == 'sidebar1' || themify_get('layout') == 'sidebar1 sidebar-left' || themify_get('layout') == 'sidebar2') { $this->layout = themify_get('layout'); } elseif (themify_check('setting-default_page_post_layout')) { $this->layout = themify_get('setting-default_page_post_layout'); } else { $this->layout = 'sidebar1'; } // 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 = is_singular('portfolio') ? 'setting-default_portfolio_single_' : 'setting-default_page_'; $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); } } elseif (is_singular('portfolio')) { if (themify_check('hide_meta_all')) { $this->hide_meta = themify_get('hide_meta_all'); } else { $this->hide_meta = themify_check('setting-default_portfolio_single_post_meta_category') ? themify_get('setting-default_portfolio_single_post_meta_category') : 'yes'; } $this->layout = 'sidebar-none'; $this->hide_title = themify_get('hide_post_title') != 'default' && themify_check('hide_post_title') ? themify_get('hide_post_title') : themify_get('setting-default_portfolio_single_title'); $this->unlink_title = themify_get('unlink_post_title') != 'default' && themify_check('unlink_post_title') ? themify_get('unlink_post_title') : themify_get('setting-default_portfolio_single_unlink_post_title'); $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->hide_date = themify_get('hide_post_date') != 'default' && themify_check('hide_post_date') ? themify_get('hide_post_date') : themify_get('setting-default_portfolio_single_post_date'); $this->post_image_width = themify_check('setting-default_portfolio_single_image_post_width') ? themify_get('setting-default_portfolio_single_image_post_width') : self::$single_portfolio_image_width; $this->post_image_height = themify_get('setting-default_portfolio_single_image_post_height') ? themify_get('setting-default_portfolio_single_image_post_height') : self::$single_portfolio_image_height; } $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->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) { if (is_singular('portfolio')) { $this->width = themify_check('setting-default_portfolio_single_image_post_width') ? themify_get('setting-default_portfolio_single_image_post_width') : self::$single_portfolio_image_width; $this->height = themify_get('setting-default_portfolio_single_image_post_height') ? themify_get('setting-default_portfolio_single_image_post_height') : self::$single_portfolio_image_height; } else { $this->width = self::$single_image_width; $this->height = self::$single_image_height; } } else { $this->width = $post_image_width; $this->height = $post_image_height; } } if (is_singular('team')) { $teampre = 'setting-default_team_single_'; if (themify_check($teampre . 'layout')) { $this->layout = themify_get($teampre . 'layout'); } else { $this->layout = 'sidebar1'; } } if (!is_singular()) { if ($this->layout == 'sidebar1' || $this->layout == 'sidebar1 sidebar-left') { $ratio = $this->width / self::$content_width; $aspect = $this->height / $this->width; if (!is_singular('portfolio')) { $this->width = round($ratio * self::$sidebar1_content_width); } if ($this->height != '' && $this->height != 0) { $this->height = round($this->width * $aspect); } } } if (is_single() && $this->hide_image != 'yes') { $this->image_align = themify_get('setting-image_post_single_align'); $this->image_setting = 'setting=image_post_single&'; } elseif ($this->query_category != '' && $this->hide_image != 'yes') { $this->image_align = ''; $this->image_setting = ''; } else { $this->image_align = themify_get('setting-image_post_align'); $this->image_setting = 'setting=image_post&'; } }
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; if ($this->layout == 'sidebar1' || $this->layout == 'sidebar1 sidebar-left') { $ratio = $this->width / self::$content_width; $aspect = $this->height / $this->width; $this->width = round($ratio * self::$sidebar1_content_width); if ($this->height != '' && $this->height != 0) { $this->height = round($this->width * $aspect); } } if (is_single() && $this->hide_image != 'yes') { $this->image_align = themify_get('setting-image_post_single_align'); $this->image_setting = 'setting=image_post_single&'; } elseif ($this->query_category != '' && $this->hide_image != 'yes') { $this->image_align = ''; $this->image_setting = ''; } else { $this->image_align = themify_get('setting-image_post_align'); $this->image_setting = 'setting=image_post&'; } }
/** * 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; }
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>
/** * Default Single Post Layout * @param array $data Theme settings data * @return string Markup for module. * @since 1.0.0 */ function themify_default_post_layout($data = array()) { $data = themify_get_data(); /** * Theme Settings Option Key Prefix * @var string */ $prefix = 'setting-default_page_'; /** * 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')); /** * 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'))); /** * Image alignment options * @var array */ $alignment_options = array(array('name' => '', 'value' => ''), array('name' => __('Left', 'themify'), 'value' => 'left'), array('name' => __('Right', 'themify'), 'value' => 'right')); /** * Module markup * @var string */ $output = ''; /** * Post sidebar placement */ $output .= '<p> <span class="label">' . __('Post Sidebar Option', 'themify') . '</span>'; $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; }
?> <?php wp_link_pages(array('before' => '<p class="post-pagination"><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php get_template_part('includes/author-box', 'single'); ?> <?php get_template_part('includes/post-nav'); ?> <?php if (!themify_check('setting-comments_posts')) { ?> <?php comments_template(); ?> <?php } ?> <?php themify_content_end(); //hook ?> </div> <!--/content --> <?php
<?php /** Themify Default Variables * @var object */ global $themify; if (themify_check('setting-post_author_box')) { ?> <div class="clearfix author-box" itemscope itemtype="http://data-vocabulary.org/Person"> <p class="author-avatar"> <?php echo get_avatar(get_the_author_meta('user_email'), $themify->avatar_size, ''); ?> </p> <div class="author-bio"> <h4 class="author-name"> <span itemprop="name"> <?php // Check whether user url exists or not if (get_the_author_meta('user_url')) { ?> <a href="<?php echo get_the_author_meta('user_url'); ?> " itemprop="url"><?php echo get_the_author_meta('first_name') . ' ' . get_the_author_meta('last_name'); ?> </a>
<?php $link = themify_get_featured_image_link(); ?> <li> <div class='slide-feature-image'> <a href="<?php echo $link; ?> " title="<?php the_title_attribute(); ?> "> <?php $auto_featured_image = themify_check('setting-auto_featured_image') ? '' : 'field_name=feature_image, post_image, image, wp_thumb&'; themify_image($auto_featured_image . "ignore=true&w={$img_width}&h={$img_height}&class=feature-img"); ?> </a> </div> <!-- /.slide-feature-image --> <div class="slide-content-wrap"> <?php if (themify_get('setting-header_slider_hide_title') != 'yes') { ?> <h3 class="slide-post-title"><a href="<?php echo $link; ?> " title="<?php
/** * Module to specify additional characters subsets * @param array Themify data * @return string Module markup * @since 1.3.9 */ function themify_webfonts_subsets($data = array()) { $html = ''; // List of fonts, recommended or full $key = 'setting-webfonts_list'; $html .= '<p> <span class="label">' . __('Google Fonts List', 'themify') . '</span>'; // Recommended list $html .= '<label for="' . esc_attr($key . '_recommended') . '"> <input ' . checked(themify_check($key) ? themify_get($key) : 'recommended', 'recommended', false) . ' type="radio" id="' . esc_attr($key . '_recommended') . '" name="' . esc_attr($key) . '" value="recommended" /> ' . __('Show recommended Google Fonts only', 'themify') . '</label><br/>'; // Full list $html .= '<span class="pushlabel"> <label for="' . esc_attr($key . '_full') . '"> <input ' . checked(themify_check($key) ? themify_get($key) : '', 'full', false) . ' type="radio" id="' . esc_attr($key . '_full') . '" name="' . esc_attr($key) . '" value="full" /> ' . __('Show all Google Fonts (showing all fonts will take longer to load)', 'themify') . '</label> </span> </p>'; // Filter by character subset $key = 'setting-webfonts_subsets'; $html .= '<p> <span class="label">' . __('Character Subsets', 'themify') . '</span> <input type="text" class="width10" name="' . esc_attr($key) . '" value="' . esc_attr(themify_get($key)) . '" /> <br /> <span class="pushlabel"> <br/><small>' . __('Enter the additional character subsets you need to use from Google Fonts separated by commas. Example: latin-ext,cyrillic', 'themify') . '</small></span> </p>'; $html .= '<p> <span class="pushlabel"><a href="#" class="refresh-webfonts button">' . __('Refresh List', 'themify') . '</a><br/><small>' . __('If you made any changes to these settings, refresh the list.', 'themify') . '</small></span> </p>'; return $html; }
?> <?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'); ?>
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; }
/** * Checks the area design setting and returns 'none' or a design option. * * @since 2.1.3 * * @param string $key Main prefix for setting and field. * @param array $args * * @return mixed */ function themify_area_design($key = 'header', $args = array()) { $args = wp_parse_args($args, array('setting' => 'setting-' . $key . '_design', 'field' => $key . '_design', 'default' => $key . '-horizontal', 'values' => array('header-horizontal', 'header-block', 'none'))); $is_shop = themify_is_woocommerce_active() && is_shop() ? true : false; if (is_singular() || $is_shop) { global $post; if ($is_shop && is_object($post)) { $temp_post = $post; $post = get_post(get_option('woocommerce_shop_page_id')); } $single = themify_get($args['field']); if ($is_shop && is_object($post)) { $post = $temp_post; } if (in_array($single, $args['values'])) { $design = $single; } } if (empty($design) || 'default' == $design) { $design = themify_check($args['setting']) ? themify_get($args['setting']) : $args['default']; } return $design; }
/** * 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; }
/** * Outputs Image Script module in theme settings. */ function themify_img_settings($data = array()) { $feature_sizes = themify_get_image_sizes_list(); $checked_use = ''; if (themify_check('setting-img_settings_use')) { $checked_use = "checked='checked'"; } $output = ' <div class="module"> <div class="themify-info-link">' . sprintf(__('The image script is used to generate images dynamically in any dimension. For more info about the image script, refer to the <a href="%s">Image Script</a> documentation.', 'themify'), 'http://themify.me/docs/image-script') . ' </div> <fieldset> <div class="label">' . __('Disable', 'themify') . '</div> <div class="row"> <label for="setting-img_settings_use"><input type="checkbox" id="setting-img_settings_use" name="setting-img_settings_use" class="disable_img_php" ' . $checked_use . '/> ' . __('Disable image script globally', 'themify') . '</label><br/> <small>' . __('Default WordPress image sizes or original images will be used.', 'themify') . '</small> <br/> </div> <div class="show_if_disabled_img_php"> <div class="label">' . __('Default Featured Image Size', 'themify') . '</div> <div class="show_if_disabled_img_php row"> <select name="setting-global_feature_size">'; foreach ($feature_sizes as $option) { if ($option['value'] == themify_get('setting-global_feature_size')) { $output .= '<option value="' . $option['value'] . '" selected="selected">'; $output .= $option['name']; $output .= '</option>'; } else { $output .= '<option value="' . $option['value'] . '">' . $option['name'] . '</option>'; } } $output .= ' </select> </div> </div> </fieldset> <!-- BEGIN Show if image script is enabled --> <div class="show_if_enabled_img_php"> <fieldset> <span class="label">' . __('Retina Images', 'themify') . '</span> <div class="row"> <label for="setting-enable_retina_desktop"><input type="checkbox" id="setting-enable_retina_desktop" name="setting-enable_retina_desktop" ' . checked(themify_check('setting-enable_retina_desktop'), 1, false) . '/> ' . __('Enable Retina Image on desktop devices.', 'themify') . '</label><br/> <br/> <label for="setting-enable_retina_mobile" class="pushlabel"><input type="checkbox" id="setting-enable_retina_mobile" name="setting-enable_retina_mobile" ' . checked(themify_check('setting-enable_retina_mobile'), 1, false) . '/> ' . __('Enable Retina Image on mobile devices.', 'themify') . '</label><br/> <span class="pushlabel"><small>' . __('When Retina Image is enabled, it will display 2-times resolution images to the devices that have retina display (eg. if the image is 200x200px, retina image would be 400x400px).', 'themify') . '</small></span> </div> </fieldset> </div> <!-- END Show if image script is enabled --> </div>'; return $output; }
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; }
function themify_img_settings($data = array()) { /*** Img.php Crop Option Array ***/ $options = array(array("value" => "c", "name" => "Center"), array("value" => "t", "name" => "Top"), array("value" => "tr", "name" => "Top Right"), array("value" => "tl", "name" => "Top Left"), array("value" => "b", "name" => "Bottom"), array("value" => "br", "name" => "Bottom Right"), array("value" => "bl", "name" => "Bottom Left"), array("value" => "l", "name" => "Left"), array("value" => "r", "name" => "Right")); $options_vertical = array(array('name' => '', 'value' => ''), array('name' => 'Yes', 'value' => 'yes'), array('name' => 'No', 'value' => 'no')); 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" name="setting-img_settings_use" ' . $checked_use . '/> Disable img.php globally<br> <small>(original source images will be used)</small> </div> <div class="label">Image Quality</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)</small> </div> <div class="label">Cropping Alignment</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</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)</small></div> </div>'; return $output; }
/** * Function that checks if meta data exists and retrieves it, otherwise checks theme setting and retrieves it instead. * If it still doesn't exist, uses the default provided. * * @since 1.0.0 * * @param string $meta * @param string $default * @param string $theme_setting * * @return mixed */ function themify_theme_get($meta, $default = '', $theme_setting = '') { global $themify; $post_type = ''; // If it's a singular view or a query page, try to get the post meta data first if (themify_is_query_page()) { // Let's check now prefixing with post type since it's a query post type page // Check without checking for custom post type $value = get_post_meta($themify->page_id, $meta, true); if ('' != $themify->query_post_type && 'post' != $themify->query_post_type) { $post_type = $themify->query_post_type . '_'; $cpt_meta = $post_type . $meta; $value = get_post_meta($themify->page_id, $cpt_meta, true); } else { } if ($value && '' != $value && 'default' != $value) { return $value; } } elseif (is_singular()) { // Check first without checking for custom post type $value = get_post_meta(get_the_ID(), $meta, true); if ($value && '' != $value && 'default' != $value) { return $value; } // Let's check now prefixing with post type if ('post' != get_post_type() && 'page' != get_post_type()) { $post_type = get_post_type() . '_'; } $cpt_meta = $post_type . $meta; $value = get_post_meta(get_the_ID(), $cpt_meta, true); if ($value && '' != $value && 'default' != $value) { return $value; } } // If there is no post meta data or is '' (default), prepare to fetch theme setting if (empty($theme_setting)) { if (themify_is_query_page() && '' != $themify->query_post_type && 'post' != $themify->query_post_type) { $post_type = $themify->query_post_type . '_'; } elseif (is_singular() && ('post' != get_post_type() && 'page' != get_post_type())) { $post_type = get_post_type() . '_'; } $theme_setting = 'setting-' . $post_type . $meta; } // Check theme setting (if there's a special setting like for portfolios it will be checked) if (themify_check($theme_setting)) { return themify_get($theme_setting); } // Prepare to check non special setting stripping out the post type from setting key if ('post' != $post_type) { $theme_setting = str_replace($post_type, '', $theme_setting); } // Check regular setting (like portfolios that rely in default layouts setting) if (themify_check($theme_setting)) { return themify_get($theme_setting); } // No luck so return default return $default; }
$cat = "&cat=" . themify_get('setting-header_slider_posts_category'); } else { $cat = ""; } if (themify_check('setting-header_slider_posts_slides')) { $num_posts = "showposts=" . themify_get('setting-header_slider_posts_slides') . "&"; } 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()) {
<?php /** * Post Navigation Template * @package themify * @since 1.0.0 */ if (!themify_check('setting-post_nav_disable')) { $in_same_cat = themify_check('setting-post_nav_same_cat') ? true : false; ?> <!-- post-nav --> <div class="post-nav clearfix"> <?php previous_post_link('<span class="prev">%link</span>', '<span class="arrow"><</span> %title', $in_same_cat); ?> <?php next_post_link('<span class="next">%link</span>', '<span class="arrow">></span> %title', $in_same_cat); ?> </div> <!-- /post-nav --> <?php }