function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $category = $instance['category']; $show_count = $instance['show_count']; $show_date = $instance['show_date'] ? true : false; $show_thumb = $instance['show_thumb'] ? true : false; $show_excerpt = $instance['show_excerpt'] ? true : false; $excerpt_length = $instance['excerpt_length']; $show_title = $instance['hide_title'] ? false : true; /* 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; } echo '<ul class="feature-posts-list">'; $query_opts = apply_filters('themify_query', array('posts_per_page' => $show_count, 'post_type' => 'post')); if ($category) { $query_opts['cat'] = $category; } query_posts($query_opts); if (have_posts()) { while (have_posts()) { the_post(); echo '<li>'; if ($show_thumb) { themify_image('ignore=true&w=' . $instance['thumb_width'] . '&h=' . $instance['thumb_height'] . '&before=<a href="' . get_permalink() . '">&after=</a>&class=post-img'); } if ($show_title) { echo '<a href="' . get_permalink() . '" class="feature-posts-title">' . get_the_title() . '</a> <br />'; } if ($show_date) { echo '<small>' . get_the_time('M d, Y') . '</small> <br />'; } if ($show_excerpt) { $the_excerpt = get_the_excerpt(); if ($excerpt_length != "") { // cut to character limit $the_excerpt = substr($the_excerpt, 0, $excerpt_length); // cut to last space $the_excerpt = substr($the_excerpt, 0, strrpos($the_excerpt, ' ')); } echo '<span class="post-excerpt">' . $the_excerpt . '</span>'; } echo '</li>'; } } else { } //Reset query_posts wp_reset_query(); echo '</ul>'; /* After widget (defined by themes). */ echo $after_widget; }
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 themify_image("field_name=feature_image, post_image, image, wp_thumb&before=<a href='" . get_permalink() . "'>&after=</a>&ignore=true&setting=header_slider&class=feature-img&w=145&h=120"); ?> <h3 class="feature-post-title"><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> </li> <?php } } wp_reset_query(); } ?>
<?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 the_title_attribute();
$themify->height = get_post_meta($post_id, 'image_height', true); } ?> <?php if ('yes' != $themify->unlink_image and !preg_match("/SN/", get_the_title())) { ?> <?php echo $before; ?> <?php themify_image('ignore=true&w=' . $themify->width . '&h=' . $themify->height); ?> <?php echo $after; ?> <?php } else { ?> <?php themify_image('ignore=true&w=' . $themify->width . '&h=' . $themify->height); ?> <?php } ?> <?php } // hide image ?> </article>
?> </h1> <?php } ?> <!-- /page-title --> <?php if ($themify->hide_page_image != 'yes' && has_post_thumbnail()) { ?> <figure class="post-image"><meta itemprop="image" content="<?php echo esc_url(wp_get_attachment_thumb_url(get_post_thumbnail_id())); ?> " /><?php themify_image("{$themify->auto_featured_image}w={$themify->page_image_width}&h=0&ignore=true"); ?> </figure> <?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
function widget($args, $instance) { extract($args); /* User-selected settings. */ $title = apply_filters('widget_title', $instance['title']); $category = $instance['category']; $show_count = $instance['show_count']; $show_date = $instance['show_date'] ? true : false; $show_thumb = $instance['show_thumb'] ? true : false; $display = isset($instance['display']) ? $instance['display'] : false; $show_excerpt = isset($instance['show_excerpt']) && $instance['show_excerpt'] ? true : false; $excerpt_length = $instance['excerpt_length']; $show_title = $instance['hide_title'] ? false : true; $orderby = isset($instance['orderby']) ? $instance['orderby'] : 'date'; $order = isset($instance['order']) ? $instance['order'] : 'DESC'; $query_opts = apply_filters('themify_query', array('posts_per_page' => $show_count, 'post_type' => 'post', 'orderby' => $orderby, 'order' => $order)); if ($category) { $query_opts['cat'] = $category; } $loop = get_posts($query_opts); if ($loop) { /* 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; } echo '<ul class="feature-posts-list">'; global $post; foreach ($loop as $post) { setup_postdata($post); echo '<li>'; $link = get_post_meta($post->ID, 'external_link', true); if (!isset($link) || '' == $link) { $link = get_permalink(); } if ($show_thumb) { themify_image('ignore=true&w=' . $instance['thumb_width'] . '&h=' . $instance['thumb_height'] . '&before=<a href="' . $link . '">&after=</a>&class=post-img'); } if ($show_title) { echo '<a href="' . $link . '" class="feature-posts-title">' . get_the_title() . '</a> <br />'; } if ($show_date) { echo '<small>' . get_the_time(apply_filters('themify_filter_widget_date', 'M d, Y')) . '</small> <br />'; } if ($show_excerpt || 'excerpt' == $display) { $the_excerpt = get_the_excerpt(); if ($excerpt_length != '') { // cut to character limit $the_excerpt = substr($the_excerpt, 0, $excerpt_length); // cut to last space $the_excerpt = substr($the_excerpt, 0, strrpos($the_excerpt, ' ')); } echo '<span class="post-excerpt">' . $the_excerpt . '</span>'; } elseif ('content' == $display) { $the_content = get_the_content(); echo '<div class="post-content">' . $the_content . '</div>'; } echo '</li>'; wp_reset_postdata(); } //end for each echo '</ul>'; /* After widget (defined by themes). */ echo $after_widget; } //end if $loop }
<?php /** Themify Default Variables * @var object */ global $themify; ?> <?php themify_image("field_name=post_image, image, wp_thumb&w=100&h=100&before=<p class='audio-image'><a href='" . get_permalink() . "'>&after=</a></p>"); ?> <!-- audio-player --> <div class="audio-player"> <?php // Load audio player echo $themify->get_audio_player(themify_get('audio_url'), $post->ID); ?> </div> <!-- /audio-player --> <!-- post-content --> <div class="post-content"> <?php if ($themify->display_content == 'excerpt') { ?> <?php the_excerpt(); ?> <?php
function themify_meta_boxes() { global $post, $themify_write_panels; echo '<div id="themify-meta-box-tabs">'; echo '<ul class="ilc-htabs themify-tabs-heading">'; foreach ($themify_write_panels as $write_panel) { if (trim($write_panel['pages']) == 'post' && $_GET['post_type'] == '' || $_GET['post_type'] == trim($write_panel['pages'])) { echo '<li><span><a id="' . sanitize_title($write_panel['name']) . 't" href="#' . sanitize_title($write_panel['name']) . '">' . $write_panel['name'] . '</a></span></li>'; } } echo '</ul>'; echo '<div class="ilc-btabs themify-tabs-body">'; foreach ($themify_write_panels as $write_panel) { $pages = explode(",", $write_panel['pages']); $check = false; foreach ($pages as $page) { if (get_post_type($post)) { if (get_post_type($post) == $page) { $check = true; } } else { if (trim($page) == 'post' && $_GET['post_type'] == '' || $_GET['post_type'] == trim($page)) { $check = true; } } } if ($check) { ?> <div id="<?php echo sanitize_title($write_panel['name']); ?> " class="ilc-tab themify_write_panel"> <div class="inside"> <input type="hidden" name="themify_proper_save" value="true" /> <script type='text/javascript'> // Themify Directory and Full Path var app_url = "<?php echo get_template_directory_uri(); ?> /themify/"; var theme_url = "<?php echo get_template_directory_uri(); ?> /"; var blog_url = "<?php echo site_url(); ?> /"; var complete_status = true; var current_obj = ""; </script> <script type="text/javascript"> jQuery(function($){ var complete_status = false; $(".themify_upload_image").click(function(e){ //$("#themify_upload_image"). }); $(".themify_field .preview-icon").click(function(e){ e.preventDefault(); $(this).parent().find(".selected").removeClass("selected"); $(this).addClass("selected"); $(this).parent().find(".val").val($(this).find("img").attr("alt")); }); $(".themify_field .query_category_single, .themify_field .query_category").blur(function(e){ $(this).parent().find(".val").val($(this).val()); }); <?php foreach ($write_panel['options'] as $meta_box) { ?> <?php if ($meta_box['type'] == "image") { ?> $("#themify_upload_image_<?php echo $meta_box['name']; ?> ").uploadify({ "uploader": "<?php echo get_template_directory_uri(); ?> /themify/js/uploadify.swf", "script": "<?php echo get_template_directory_uri(); ?> /themify/themify-ajax.php?upload-wordpress=true", "folder": "uploads", "cancelImg": "", "height": "23", "width": "66", "method": "POST", "hideButton": true, "wmode": "transparent", "fileDesc": "Image Files", "fileExt": "*.jpg;*.jpeg;*.gif;*.png", "multi": true, "sizeLimit": 100 * 1024 * 1024, "auto": true }); $("#themify_upload_image_<?php echo $meta_box['name']; ?> ").bind({ "uploadifySelect": function (a, b, c) { showAlert() }, "uploadifyOpen": function (a, b, c) {}, "uploadifyError": function (a, b, c, d) {}, "uploadifyProgress": function (a, b, c, d) {}, "uploadifyCancel": function (a, b, c, d) { hideAlert() }, "uploadifyComplete": function (a, b, c, d, e) { d = d.replace("%uFEFF",""); var f = $.trim(decodeURI(d)); var file = f.replace("%3A",":"); f = f.replace("%3A",":"); f = f.replace("%3A",":"); hideAlert(); $(this).parent().parent().find(".themify_upload_field").val(f); $(this).parent().parent().parent().find(".themify_upload_preview").html("<img src=\'<?php echo get_template_directory_uri(); ?> /themify/img.php?w=40&h=40&src=" + f + "\' alt=\'" + f + "\' />").fadeIn(200); } }); <?php } ?> <?php } ?> function showAlert() { $(".alert").addClass("busy").fadeIn(800) } function hideAlert() { $(".alert").removeClass("busy").addClass("done").delay(800).fadeOut(800, function () { $(this).removeClass("done") }) } }); </script> <!-- alerts --> <div class="alert"></div> <!-- /alerts --> <?php foreach ($write_panel['options'] as $meta_box) { ?> <?php $meta_value = get_post_meta($post->ID, $meta_box['name'], true); ?> <?php /////////////////////////////////////////// // Image Template /////////////////////////////////////////// ?> <?php if ($meta_box['type'] == 'image') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <input type="text" name="<?php echo $meta_box['name']; ?> " value="<?php echo $meta_value; ?> " size="55" class="themify_input_field themify_upload_field" /> <span class="themify_upload_buttons"> <a href="#" class="button button-highlighted">Upload</a> <a href="#" id="themify_upload_image_<?php echo $meta_box['name']; ?> " class="button button-highlighted">swf</a> </span><br /> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> <?php if ($meta_value != "") { ?> <div class="themify_upload_preview" style="display:block;"><?php themify_image('w=40&h=40&src=' . $meta_value); ?> </div> <?php } else { ?> <div class="themify_upload_preview"></div> <?php } ?> </div><!--/themify_field_row --> <?php /////////////////////////////////////////// // Dropdown Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'dropdown') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <select name="<?php echo $meta_box['name']; ?> "> <?php foreach ($meta_box['meta'] as $option) { ?> <?php if ($option['value'] == $meta_value) { $selected = "selected='selected'"; } else { $selected = ""; } ?> <option value="<?php echo $option['value']; ?> " <?php echo $selected; ?> ><?php echo $option['name']; ?> </option> <?php } ?> </select> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> </div><!--/themify_field_row --> <?php /////////////////////////////////////////// // Textbox Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'textbox') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <?php if ($meta_box['meta']['size'] != '' && $meta_box['meta']['size'] == 'small') { $class = "small"; } else { $class = ""; } ?> <input type="text" name="<?php echo $meta_box['name']; ?> " value="<?php echo $meta_value; ?> " size="55" class="themify_input_field <?php echo $class; ?> " /> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> </div><!--/themify_field_row --> <?php /////////////////////////////////////////// // Checkbox Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'checkbox') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <?php if ($meta_value) { $checked = "checked='checked'"; } else { $checked = ""; } ?> <div class="themify_field"> <input type="checkbox" name="<?php echo $meta_box['name']; ?> " <?php echo $checked; ?> class="" /> <span class="themify_checkbox_description"><?php echo $meta_box['description']; ?> </span> </div> </div><!--/themify_field_row --> <?php /////////////////////////////////////////// // Layout Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'layout') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <?php foreach ($meta_box['meta'] as $options) { ?> <?php if (($meta_value == "" || !$meta_value || !isset($meta_value)) && $options['selected']) { $meta_value = $options['value']; } if ($meta_value == $options['value']) { $class = "selected"; } else { $class = ""; } ?> <a href="#" class="preview-icon <?php echo $class; ?> "><img src="<?php echo get_template_directory_uri() . "/" . $options['img']; ?> " alt="<?php echo $options['value']; ?> " /></a> <?php } ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> " value="<?php echo $meta_value; ?> " class="val" /> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> </div> <?php /////////////////////////////////////////// // Query Posts Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'query_category') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <?php echo preg_replace('/>/', '><option></option>', wp_dropdown_categories(array("class" => "query_category_single", "show_option_all" => "All Categories", "hide_empty" => 0, "echo" => 0, "name" => $meta_box['name'], "selected" => $meta_value)), 1); ?> or <input type="text" class="query_category" value="<?php echo $meta_value; ?> " /> <input type="hidden" value="<?php echo $meta_value; ?> " name="<?php echo $meta_box['name']; ?> " class="val" /> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> </div> <?php /////////////////////////////////////////// // Sidebar Visibility Template /////////////////////////////////////////// ?> <?php } else { if ($meta_box['type'] == 'sidebar_visibility') { ?> <input type="hidden" name="<?php echo $meta_box['name']; ?> _noncename" id="<?php echo $meta_box['name']; ?> '_noncename" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?> " /> <div class="themify_field_row clearfix"> <div class="themify_field_title"><?php echo $meta_box['title']; ?> </div> <div class="themify_field"> <?php $sidebars = get_option('sidebars_widgets'); global $wp_registered_sidebars; foreach ($sidebars as $sidebar => $val) { if ($sidebar != 'wp_inactive_widgets' && $sidebar != 'array_version' && strpos(strtolower($wp_registered_sidebars[$sidebar]['name']), 'sidebar') !== false) { $checked = ""; if (get_post_meta($post->ID, $meta_box['name'], true) == "" || !get_post_meta($post->ID, $meta_box['name'], true)) { $checked = "checked='checked'"; } else { foreach ($meta_value as $key => $val) { if (str_replace("'", "", $key) == $wp_registered_sidebars[$sidebar]['name']) { $checked = "checked='checked'"; } } } ?> <input type="checkbox" name="<?php echo $meta_box['name']; ?> [<?php echo $wp_registered_sidebars[$sidebar]['name']; ?> ]" class="" <?php echo $checked; ?> /> <?php echo $wp_registered_sidebars[$sidebar]['name']; ?> <br /> <?php } } ?> <span class="themify_field_description"><?php echo $meta_box['description']; ?> </span> </div> </div> <?php } } } } } } } ?> <?php } ?> </div> </div> <?php } } echo '</div>'; //end .ilc-btabs echo '</div>'; //end #themify-meta-box-tabs echo '<script type="text/javascript">'; echo 'jQuery(document).ready(function(){'; echo 'if(jQuery(".ilc-htabs li").length > 1)'; echo 'ilcTabs({ilctabs : "#themify-meta-box-tabs"});'; echo 'else{'; echo 'jQuery(".ilc-tab").show();'; echo 'jQuery(".ilc-htabs li").addClass("select");'; echo '}'; echo '});'; echo '</script>'; }
<?php echo $themify->get_video_embed(themify_get('video_url')); ?> <?php } else { ?> <div class='slide-feature-image'> <a href="<?php echo $themify->get_featured_image_link(); ?> " title="<?php the_title_attribute(); ?> "> <?php themify_image($themify->auto_featured_image . "ignore=true&w={$img_width}&h={$img_height}&class=feature-img&alt=" . get_the_title()); ?> </a> </div> <!-- /.slide-feature-image --> <?php } ?> <div class="slide-content-wrap"> <?php if (themify_get('setting-footer_slider_hide_title') != 'yes') { ?> <h3 class="slide-post-title"><a href="<?php the_permalink();
} else { ?> <?php if ($hide_image != "yes") { ?> <?php if ($unlink_image == "yes") { ?> <?php themify_image("field_name=post_image, image, wp_thumb&setting=image_post&w=" . $width . "&h=" . $height . "&before=<p class='post-image " . themify_get('setting-image_post_align') . "'>&after=</p>"); ?> <?php } else { ?> <?php themify_image("field_name=post_image, image, wp_thumb&setting=image_post&w=" . $width . "&h=" . $height . "&before=<p class='post-image " . themify_get('setting-image_post_align') . "'><a href='" . urlencode($link) . "'>&after=</a></p>"); ?> <?php } ?> <?php } ?> <?php } ?> <div class="post-content"> <?php if ($hide_date != "yes") {
</div> <body <?php body_class($class); ?> > <div id="pagewrap"> <div id="header" class="pagewidth"> <div id="site-logo"> <?php if (themify_get('setting-site_logo') == 'image' && themify_check('setting-site_logo_image_value')) { ?> <?php themify_image("src=" . themify_get('setting-site_logo_image_value') . "&w=" . themify_get('setting-site_logo_width') . "&h=" . themify_get('setting-site_logo_height') . "&alt=" . get_bloginfo('name') . "&before=<a href='" . get_option('home') . "'>&after=</a>"); ?> <?php } else { ?> <a href="<?php echo get_option('home'); ?> /"><?php bloginfo('name'); ?> </a> <?php } ?> </div>