/** * Display the post content with a link to the single post * @since 1.0.0 */ function actions_post_content() { if (is_search()) { ?> <header class="page-header"> <h1 class="page-title"><?php printf(__('Search Results for: %s', 'actions'), '<span>' . esc_html(get_search_query()) . '</span>'); ?> </h1> </header><!-- .page-header --> <?php } while (have_posts()) { the_post(); ?> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php actions_post_header(); ?> <div class="entry-content"> <?php actions_post_thumbnail('full'); if ('post' == get_post_type()) { ?> <div class="entry-meta"> <?php actions_posted_on(); ?> </div> <?php } if (is_search()) { the_excerpt(); } else { the_content(sprintf(__('Continue reading %s', 'actions'), '<span class="screen-reader-text">' . esc_url(get_the_title()) . '</span>')); } wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'actions'), 'after' => '</div>')); //actions_entry_footer(); ?> </div><!-- .entry-content --> </article><!-- #post-## --> <?php } }
function Page() { ?> <div class="article"> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php Page_Header(); ?> <?php Article_Content(); ?> <?php Page_Footer(); ?> </article> </div> <?php }
/** * Outputs the content for a new widget instance. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ function widget($args, $instance) { extract($args); if (isset($instance['page']) && $instance['page'] != -1) { $page_id = (int) $instance['page']; $p = new WP_Query(array('page_id' => $page_id)); if ($p->have_posts()) { $p->the_post(); $title = apply_filters('widget_title', empty($instance['title']) ? get_the_title() : $instance['title'], $instance, $this->id_base); echo $before_widget; echo $before_title; echo $title; echo $after_title; ?> <div id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php the_content(); ?> </div> <?php echo $after_widget; wp_reset_postdata(); } } }
function Search() { ?> <div class="article"> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php Search_Header(); ?> <?php Article_Summary(); ?> <?php Article_Footer(); ?> </article> </div> <?php }
function ssm_home_loop() { ?> <?php do_action('genesis_before_entry'); ?> <article <?php post_class(); ?> itemscope="itemscope" itemtype="http://schema.org/CreativeWork"> <div class="entry-content" itemprop="text"> <?php include 'templates/includes/content-blocks.php'; ?> </div> <!-- entry-content --> </article> <?php do_action('genesis_after_entry'); ?> <?php }
function section_template() { $loop = new fotosPostLoop(); $artsep = pl_setting('ba_fotos_art_sep'); if (have_posts()) { while (have_posts()) { the_post(); ?> <article <?php post_class('fotos-article'); ?> id="post-<?php the_ID(); ?> " itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost"><?php $loop->post_header(); $loop->post_content(); $loop->post_social(); $loop->post_comments(); ?> </article><?php if ($artsep && is_home()) { echo $artsep; } } } else { echo 'Sorry no posts found'; } }
function Article() { ?> <div class="article"> <article id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <?php Article_Header(); ?> <?php if (is_single()) { Article_Content(); } else { Article_Continue(); } ?> <?php Article_Footer(); ?> </article> </div> <?php }
function html5slidefunction($title_slide) { global $post; $html5slide_type = get_post_meta($post->ID, 'html5slide_type', true); echo '<article '; post_class(); echo '>'; if ($html5slide_type == 'title_slide') { echo '<h1>' . get_the_title() . '</h1>'; the_content(); } elseif ($html5slide_type == 'no_title') { the_content(); } elseif ($html5slide_type == 'segue_slide') { echo '<h2>' . get_the_title() . '</h2>'; } else { if ($post->post_parent == 0) { echo '<h1>' . get_the_title() . '</h1>'; } else { echo '<h3>' . get_the_title() . '</h3>'; } the_content(); } if (isset($GLOBALS['html5presentation_edit'])) { edit_post_link('edit slide', '<div class="html5_edit' . $GLOBALS['html5presentation_edit'] . '">', '</div>'); } echo '</article>'; }
function render_content() { ?> <?php if (have_posts()) { ?> <div class="loop"> <div class="loop-content"> <?php while (have_posts()) { // The Loop ?> <?php the_post(); ?> <div id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <!-- title, meta, and date info --> <div class="entry-header clearfix"> <h1 class="entry-title"><?php the_title(); ?> </h1> </div> <!-- post content --> <div class="entry-content clearfix"> <?php the_content(); ?> </div> <?php get_search_form(); ?> </div> <!-- end .post --> <?php } // end of one post ?> </div> </div> <?php } else { // do not delete ?> <?php do_action('builder_template_show_not_found'); ?> <?php } // do not delete }
function categori_news(){ query_posts('cat=9&showposts=10&posts_per_page=3'); while (have_posts()) : the_post(); /*Dima insert*/the_excerpt(); ?> <div class="content-box"> <div class="bgr01"><div class="bgr02"><div class="bgr03"> <div <?php post_class() ?> id="post-<?php the_ID(); ?>" style=" float:none; "> <div class="title"> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="date_all"> <?php the_time('l, j ?F, Y') ?> </div> <div class="post"> Написал <?php the_author_link() ?> <?php the_time('g:i A') ?> </div> </div> <div class="content_box"> <?php the_content('Читать всё'); ?> </div> <div class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?></div> <div class="comments"><?php comments_popup_link('0 комментарии', 'комментарии', '% комментарии '); ?></div> <div class="link-edit"><?php edit_post_link('Edit', ''); ?></div> </div> </div></div></div> </div> <?php endwhile;}
function thesis_teaser($classes, $post_count = false, $right = false) { $classes = 'teaser'; $post_image = thesis_post_image_info('thumb'); if ($right) { $classes .= ' teaser_right'; } thesis_hook_before_teaser_box($post_count); #hook ?> <div <?php post_class($classes); ?> id="post-<?php the_ID(); ?> "> <?php thesis_build_teaser($post_count, $post_image); ?> </div> <?php thesis_hook_after_teaser_box($post_count); #hook echo $close_box; }
function rb_portfolio_loop_content() { if (have_posts()) { add_thickbox(); while (have_posts()) { the_post(); ?> <article <?php post_class(); ?> > <?php rb_portfolio_add_image(); //rb_portfolio_featured_post_image(); the_date('F Y', '<span class="portfolio-date">', '</span>'); genesis_do_post_title(); rb_portfolio_add_authors(); rb_portfolio_display_thickbox_content(); ?> </article> <?php } } }
function cases_display_childs_cp() { global $post; $query = new WP_Query('post_type=cases&post_parent=' . $post->ID); if (!is_singular('cases')) { return; } ?> <section id="person_dossier" class="cases-box"> <header class="cases-box-header"> <h1>Досье</h1> <hr> </header> <article class="cases-box-content"> <ul> <?php while ($query->have_posts()) { $query->the_post(); ?> <li role="article" id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <header class="entry-header"> <a href="<?php the_permalink(); ?> "> <h2 class="entry-title"><?php the_title(); ?> </h2> </a> </header> <section id='meta-case'> <ul class="list-inline"> <?php do_action('case_meta_top_add_li'); ?> </ul> </section> </li><!-- #post-<?php the_ID(); ?> --> <?php } wp_reset_postdata(); ?> </ul> </article> </section> <?php }
/** @see WP_Widget::widget -- do not rename this */ function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $link = $instance['link']; $textarea = wpautop($instance['textarea']); $count = 0; echo $before_widget; if ($title) { echo '<header>'; echo '<h4 class="widget-title widgettitle portfolio-widget-title">'; echo $title; echo '</h4>'; echo '</header>'; } if ($textarea) { echo '<div class="entry-widget_content entry-content portfolio-widget-content">'; echo $textarea; echo '</div>'; } if (have_posts()) { echo '<div class="full-width-content post-type-archive-portfolio">'; add_thickbox(); $args = array('post_type' => 'portfolio', 'posts_per_page' => '4'); $portfolio_query = new WP_Query($args); while ($portfolio_query->have_posts()) { $portfolio_query->the_post(); $add_class = array('one-fourth'); if ($count == 0 || $count == 4) { $add_class[] = 'first'; echo '<div class="clear"></div>'; } ?> <article <?php post_class($add_class); ?> > <?php rb_portfolio_add_image(); // the_date( 'F Y', '<span class="portfolio-date">', '</span>' ); genesis_do_post_title(); // rb_portfolio_add_authors(); rb_portfolio_display_thickbox_content(); ?> </article> <?php $count++; } } wp_reset_query(); echo '<div class="clear"></div>'; echo '</div>'; // .full-width-content.post-type-archive-portfolio echo $after_widget; }
function widget($args, $instance) { extract($args, EXTR_SKIP); global $icon; $icon = $instance['icon']; $title = apply_filters('widget_title', $instance['title']); $number = $instance['number']; /* before widget */ echo $before_widget; /* display title */ if ($title && $icon) { echo $before_title . '<i class="fa ' . $icon . ' "></i>' . $title . $after_title; } elseif ($title) { echo $before_title . $title . $after_title; } /* display the widget */ ?> <div <?php post_class(); ?> id="images-widget-<?php the_ID(); ?> "> <div class="gallery-widget"> <ul> <?php global $post; $args = array('order' => 'DESC', 'post_type' => 'gallery', 'posts_per_page' => 1); $loop = new WP_Query($args); while ($loop->have_posts()) { $loop->the_post(); $images = rwmb_meta('gxg_gallery_images', 'type=image&size=square2', false); $i = 0; foreach ($images as $image) { $imageurl = $image['url']; $imagefull = $image['full_url']; if ($i++ < $number) { echo "<li class='prettyimage-wrap'><a class='pretty_image' title='' data-rel='prettyPhoto[pp_gallery]' href='{$imagefull}'><span class='image-rollover'><i class='gallery-resize-icon fa fa-expand'></i></span><img src='{$imageurl}' alt='' /></a></li>"; } } } wp_reset_query(); ?> </ul> </div><!-- .gallery-widget --> </div><!-- .post-? --> <?php /* after widget */ echo $after_widget; }
public function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = $this->id; } $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); $number = !empty($instance['number']) ? absint($instance['number']) : 5; if (!$number) { $number = 5; } $args_article = array('posts_per_page' => $number, 'no_found_rows' => true, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'order' => $instance['order'], 'orderby' => $instance['orderby']); if (is_array($instance['category'])) { $args_article['category__in'] = $instance['category']; } $r = new WP_Query(apply_filters('widget_posts_args', $args_article)); if ($r->have_posts()) { echo $args['before_widget']; if ($title) { echo $args['before_title'] . $title . $args['after_title']; } ?> <ul class="kt_posts_carousel_widget"> <?php while ($r->have_posts()) { $r->the_post(); ?> <li <?php post_class('article-widget clearfix'); ?> > <?php kt_post_thumbnail_image('kt_widget_article_carousel', 'img-responsive'); ?> <div class="article-attr"> <h3 class="title"> <a href="<?php the_permalink(); ?> "> <?php get_the_title() ? the_title() : the_ID(); ?> </a> </h3> </div> </li> <?php } ?> </ul> <?php echo $args['after_widget']; wp_reset_postdata(); } }
function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, array('title' => '', 'posts_cat' => '', 'posts_num' => '', 'posts_offset' => '', 'orderby' => '', 'order' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => '')); echo $before_widget; $featured_posts = new WP_Query(array('cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order'])); if ($featured_posts->have_posts()) { while ($featured_posts->have_posts()) { $featured_posts->the_post(); echo '<li '; post_class('feature-post'); echo '>'; if (!empty($instance['show_image'])) { echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="' . esc_attr($instance['image_alignment']) . ' feature-image">'; genesis_image(array('format' => 'html', 'size' => $instance['image_size'])); echo '</a>'; } if (!empty($instance['show_title'])) { echo '<h2 class="title"><a href="' . get_permalink() . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a></h2>'; } if (!empty($instance['show_byline'])) { echo '<p class="byline">'; the_time('F j, Y'); echo ' ' . __('by', 'genesis') . ' '; the_author_posts_link(); echo ' · '; comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis')); echo ' '; edit_post_link(__('(Edit)', 'genesis'), '', ''); echo '</p>'; } if (!empty($instance['show_content'])) { if ($instance['show_content'] == 'excerpt') { the_excerpt(); } elseif ($instance['show_content'] == 'content-limit') { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } else { the_content(esc_html($instance['more_text'])); } } echo '</li><!--end post_class()-->' . "\n\n"; if (!empty($instance['show_slider_nav'])) { $slider_nav .= '<li><a href="#"></a></li>'; } } } echo $after_widget; echo '<div class="feature-nav ' . esc_attr($instance['image_alignment']) . '">'; echo '<ul>'; echo $slider_nav; echo '</ul></div>'; wp_reset_query(); }
/** * Displays single product loop * * Uses WooCommerce structure and contains all existing WooCommerce hooks * * Code based on WooCommerce 1.5.5 woocommerce_single_product_content() * @see woocommerce/woocommerce-template.php * * @since 0.9.0 */ function gencwooc_single_product_loop() { do_action('woocommerce_before_main_content'); // Let developers override the query used, in case they want to use this function for their own loop/wp_query $wc_query = false; // Added a hook for developers in case they need to modify the query $wc_query = apply_filters('gencwooc_custom_query', $wc_query); if (!$wc_query) { global $wp_query; $wc_query = $wp_query; } if ($wc_query->have_posts()) { while ($wc_query->have_posts()) { $wc_query->the_post(); ?> <?php do_action('woocommerce_before_single_product'); ?> <div itemscope itemtype="http://schema.org/Product" id="product-<?php the_ID(); ?> " <?php post_class(); ?> > <?php do_action('woocommerce_before_single_product_summary'); ?> <div class="summary"> <?php do_action('woocommerce_single_product_summary'); ?> </div> <?php do_action('woocommerce_after_single_product_summary'); ?> </div> <?php do_action('woocommerce_after_single_product'); } } do_action('woocommerce_after_main_content'); }
function themerex_wrapper_start() { $blog_style = 'fullpost'; //get_custom_option('blog_style'); $post_format = 'standard'; ?> <article <?php post_class('theme_article post_format_' . $post_format); ?> > <div class="post_content"> <?php }
/** * Add an "active" class to the first carousel item. */ function featured_post_class($class = '', $post_id = null) { global $featured; if ($class) { $class .= ' '; } if ($featured->current_post === 0) { $class .= 'active'; return post_class($class, $post_id); } else { return post_class($class, $post_id); } }
/** * This is a standard loop, and is meant to be executed, without * modification, in most circumstances where content needs to be displayed. * * It outputs basic wrapping HTML, but uses hooks to do most of its * content output like title, content, post information and comments. * * The action hooks called are: * genesis_before_post, * genesis_before_post_title, * genesis_post_title, * genesis_after_post_title, * genesis_before_post_content, * genesis_post_content * genesis_after_post_content * genesis_after_post, * genesis_after_endwhile, * genesis_loop_else (only if no posts were found). * * @since 1.1.0 * * @global integer $loop_counter Increments on each loop pass */ function genesis_standard_loop() { global $loop_counter; $loop_counter = 0; if (have_posts()) { while (have_posts()) { the_post(); do_action('genesis_before_post'); ?> <div <?php post_class(); ?> > <?php do_action('genesis_before_post_title'); ?> <?php do_action('genesis_post_title'); ?> <?php do_action('genesis_after_post_title'); ?> <?php do_action('genesis_before_post_content'); ?> <div class="entry-content"> <?php do_action('genesis_post_content'); ?> </div><!-- end .entry-content --> <?php do_action('genesis_after_post_content'); ?> </div><!-- end .postclass --> <?php do_action('genesis_after_post'); $loop_counter++; } /** end of one post **/ do_action('genesis_after_endwhile'); } else { /** if no posts exist **/ do_action('genesis_loop_else'); } /** end loop **/ }
function rt_widget_posts() { $options = get_option("rt_widget_posts"); query_posts('cat=' . $options['category_id']); if (have_posts()) { while (have_posts()) { global $post; the_post(); ?> <div class="post_thumb"><img src="<?php echo get_post_meta($post->ID, 'rt_thumb', TRUE); ?> "</div> <div <?php post_class(); ?> id="post-<?php the_ID(); ?> "> <h3><a href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a></h3> <div class="summary"> <?php the_excerpt(); ?> </div> </div> <?php } } else { ?> <p><?php _e('Sorry, no posts matched your criteria.'); ?> </p> <?php } }
function widget($args, $instance) { global $post; $posts = get_field('products', 'widget_' . $args['widget_id']); if ($posts) { echo $args['before_widget']; if (!empty($instance['title'])) { if (!empty($instance['description'])) { echo '<div class="widget-header">'; echo $args['before_title'] . $instance['title'] . $args['after_title']; echo '<div class="widget-description">' . $instance['description'] . '</div>'; echo '</div>'; } else { echo $args['before_title'] . $instance['title'] . $args['after_title']; } } ?> <ul class="products"> <?php foreach ($posts as $post) { ?> <?php setup_postdata($post); ?> <?php $class = array(); $class[] = has_post_thumbnail() ? 'has-thumbnail' : ''; ?> <li <?php post_class(); ?> > <?php include_module('product-item', array('title' => get_the_title(), 'designer' => get_field('designer'), 'price' => get_field('price'), 'url' => get_field('external_url'), 'image_url' => get_post_thumbnail_src(array('width' => 210)))); ?> </li> <?php } ?> </ul> <?php echo $args['after_widget']; wp_reset_postdata(); wp_reset_query(); } }
/** * * This function outputs the loop for any of CRM Press' pages or posts. This is the meat of the theme and where a lot of the action happens. * * The following hooks are added to this function by default: * * crmpress_before_post, crmpress_before_post_title, crmpress_post_title, crmpress_after_post_title, crmpress_before_post_content, crmpress_post_content, * crmpress_after_post_content, crmpress_after_post, crmpress_pagination, crmpress_alternate_loop * * @since 1.0 * */ function crmpress_do_content() { if (have_posts()) { while (have_posts()) { the_post(); // Begin our content loop global $post, $prefix; do_action('crmpress_before_post'); ?> <article <?php post_class(); ?> > <?php do_action('crmpress_before_post_title'); ?> <?php do_action('crmpress_post_title'); ?> <?php do_action('crmpress_after_post_title'); ?> <?php do_action('crmpress_before_post_content'); ?> <?php do_action('crmpress_post_content'); ?> <?php do_action('crmpress_after_post_content'); ?> </article><!--end .post_class--> <?php do_action('crmpress_after_post'); } // Partially end our loop. We'll add in another loop if we have no posts do_action('crmpress_pagination'); // Add pagination on posts if necessary } else { do_action('crmpress_alternate_loop'); } }
function widget($args, $instance) { extract($args); $instance = wp_parse_args((array) $instance, array('title' => '', 'page_id' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => '')); echo $before_widget; // Set up the author bio if (!empty($instance['title'])) { echo $before_title . apply_filters('widget_title', $instance['title']) . $after_title; } $featured_page = new WP_Query(array('page_id' => $instance['page_id'])); if ($featured_page->have_posts()) { while ($featured_page->have_posts()) { $featured_page->the_post(); echo '<div '; post_class(); echo '>'; if (!empty($instance['show_image'])) { printf('<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute('echo=0'), esc_attr($instance['image_alignment']), genesis_get_image(array('format' => 'html', 'size' => $instance['image_size']))); } if (!empty($instance['show_title'])) { printf('<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute('echo=0'), the_title_attribute('echo=0')); } if (!empty($instance['show_byline'])) { echo '<p class="byline">'; the_time('F j, Y'); echo ' ' . __('by', 'genesis') . ' '; the_author_posts_link(); echo g_ent(' · '); comments_popup_link(__('Leave a Comment', 'genesis'), __('1 Comment', 'genesis'), __('% Comments', 'genesis')); echo ' '; edit_post_link(__('(Edit)', 'genesis'), '', ''); echo '</p>'; } if (!empty($instance['show_content'])) { if (empty($instance['content_limit'])) { the_content($instance['more_text']); } else { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } } echo '</div><!--end post_class()-->' . "\n\n"; } } echo $after_widget; wp_reset_query(); }
function widget($args, $instance) { global $post; /** defaults */ $instance = wp_parse_args($instance, array('post_id' => '', 'title' => '', 'show_agent' => 0, 'show_number' => 1, 'orderby' => '', 'order' => '')); extract($args); $post_id = $instance['post_id']; $title = $instance['title']; $orderby = $instance['orderby']; $order = $instance['order']; $show_agent = $instance['show_agent']; $show_number = !empty($instance['show_number']) ? absint($instance['show_number']) : 1; echo $before_widget; if ($show_agent == 'show_all') { echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title; $query_args = array('post_type' => 'employee', 'posts_per_page' => -1, 'orderby' => $orderby, 'order' => $order); } elseif ($show_agent == 'show_random') { echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title; $query_args = array('post_type' => 'employee', 'posts_per_page' => $show_number, 'orderby' => 'rand', 'order' => $order); } elseif (!empty($instance['post_id'])) { $post_id = explode(',', $instance['post_id']); echo $before_title . apply_filters('widget_title', $title, $instance, $this->id_base) . $after_title; $query_args = array('post_type' => 'employee', 'p' => $post_id[0], 'posts_per_page' => 1, 'orderby' => $orderby, 'order' => $order); } query_posts($query_args); if (have_posts()) { while (have_posts()) { the_post(); echo '<div ', post_class('widget-agent-wrap'), '>'; echo '<a href="', get_permalink(), '">', get_the_post_thumbnail($post->ID, 'employee-thumbnail'), '</a>'; printf('<div class="widget-agent-details"><a class="fn" href="%s">%s</a>', get_permalink(), get_the_title()); echo impa_employee_archive_details(); if (function_exists('_p2p_init') && function_exists('agentpress_listings_init') || function_exists('_p2p_init') && function_exists('wp_listings_init')) { $has_listings = impa_has_listings($post->ID); if (!empty($has_listings)) { echo '<p><a class="agent-listings-link" href="' . get_permalink() . '#agent-listings">View My Listings</a></p>'; } } echo '</div>'; //echo impa_employee_social(); echo '</div><!-- .widget-agent-wrap -->'; } } wp_reset_query(); echo $after_widget; }
function loop_shortcode($atts) { ob_start(); extract(shortcode_atts(array('type' => 'post', 'order' => 'date', 'orderby' => 'title', 'posts' => -1, 'taxonomy' => '', 'term' => '', 'category' => ''), $atts)); // Check if there's a tax and term specified if ($type && $taxonomy && $term) { $options = array('post_type' => $type, 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => $posts, 'tax_query' => array(array('taxonomy' => $taxonomy, 'field' => 'slug', 'terms' => $term)), 'category_name' => $category); } else { $options = array('post_type' => $type, 'order' => $order, 'orderby' => $orderby, 'posts_per_page' => $posts, 'category_name' => $category); } $query = new WP_Query($options); if ($query->have_posts()) { ?> <ul class="now-loop"> <?php while ($query->have_posts()) { $query->the_post(); ?> <li id="post-<?php the_ID(); ?> " <?php post_class(); ?> > <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a> </li> <?php } wp_reset_postdata(); ?> </ul> <?php $loopvariable = ob_get_clean(); return $loopvariable; } }
function themerex_wrapper_start() { $blog_style = 'fullpost'; //get_custom_option('blog_style'); $post_format = 'standard'; ?> <div id="main_inner" class="clearboth blog_style_<?php echo esc_attr($blog_style); ?> "> <div id="content" class="content_blog post_single" role="main"> <article <?php post_class('theme_article post_format_' . $post_format); ?> > <div class="post_content"> <?php }
function widget($args, $instance) { extract($args, EXTR_SKIP); $title = empty($instance['title']) ? ' ' : apply_filters('widget_title', $instance['title']); $gallery = empty($instance['gallery']) ? ' ' : apply_filters('widget_gallery', $instance['gallery']); /** * Output the HTML for this widget. */ echo $before_widget; if (!empty($title)) { echo $before_title . $title . $after_title; } echo '<div id="gallery-post-format-widget">'; $custom = new WP_Query(array('order' => 'DESC', 'posts_per_page' => 1, 'no_found_rows' => true, 'post_status' => 'publish', 'post__not_in' => get_option('sticky_posts'), 'tax_query' => array(array('taxonomy' => 'post_format', 'terms' => array("post-format-gallery"), 'field' => 'slug', 'operator' => 'IN')))); if ($custom->have_posts()) { while ($custom->have_posts()) { $custom->the_post(); $tmp_more = $GLOBALS['more']; $GLOBALS['more'] = 0; ?> <article <?php post_class(); ?> > <?php if (has_post_format('gallery')) { the_content(); } printf('<span class="entry-meta"><time class="entry-date" datetime="%2$s">%3$s</time></span>', esc_url(get_permalink()), esc_attr(get_the_date('c')), esc_html(get_the_date())); ?> </article> <?php } } // Reset the post globals as this query will have stomped on it. wp_reset_postdata(); ?> <?php echo '<p><a href="' . get_post_format_link('gallery') . '" class="widget-format-link"><span class="screen-reader-text">' . $gallery . '</span></a></p>'; echo '</div>'; echo $after_widget; }
function widget($args, $instance) { extract($args); echo $before_widget; $slider_nav = ''; $featured_posts = new WP_Query(array('cat' => $instance['posts_cat'], 'showposts' => $instance['posts_num'], 'offset' => $instance['posts_offset'], 'orderby' => $instance['orderby'], 'order' => $instance['order'])); if ($featured_posts->have_posts()) { while ($featured_posts->have_posts()) { $featured_posts->the_post(); echo '<li '; post_class('slider-post'); echo '>'; if (!empty($instance['show_image'])) { echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="' . esc_attr($instance['image_alignment']) . ' slider-show-image">'; genesis_image(array('format' => 'html', 'size' => $instance['image_size'])); echo '</a>'; } if (!empty($instance['show_title'])) { echo '<h2 class="slider-title"><a href="' . get_permalink() . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a></h2>'; } if (!empty($instance['show_content'])) { if ($instance['show_content'] == 'excerpt') { the_excerpt(); } elseif ($instance['show_content'] == 'content-limit') { the_content_limit((int) $instance['content_limit'], esc_html($instance['more_text'])); } else { the_content(esc_html($instance['more_text'])); } } echo '</li><!--end post_class()-->' . "\n\n"; if (!empty($instance['show_slider_nav'])) { $slider_nav .= '<li><a href="#" class="nav-thumb-wrapper">' . genesis_get_image(array('format' => 'html', 'size' => 'Slider Thumbnail', 'attr' => array('class' => 'nav-thumb-image'))) . '</a></li>'; } } } echo $after_widget; echo '<div id="slider-nav">'; echo '<a class="nav-prev" href="#">Previous</a>'; echo '<a class="nav-next" href="#">Next</a>'; echo '<ul class="nav-thumbs">'; echo $slider_nav; echo '</ul></div>'; wp_reset_query(); }