?> <a <?php if ($brickyard_related_posts_format == 'Slider') { ?> class="slider-link" title="<?php the_title(); ?> "<?php } ?> href="<?php echo get_permalink(); ?> "><?php if ($brickyard_related_posts_format == 'Slider') { brickyard_short_title(); } else { the_title(); } ?> </a></li> <?php } ?> </ul> </div> </div> </div> </div> <?php }
function widget($args, $instance) { // outputs the content of the widget extract($args); $title = apply_filters('widget_title', $instance['title']); $category = apply_filters('widget_category', $instance['category']); $numberposts = apply_filters('widget_numberposts', $instance['numberposts']); echo $before_widget; ?> <section class="home-slider-posts"> <?php $args1 = array('cat' => $category, 'showposts' => $numberposts, 'post_type' => 'post', 'post_status' => 'publish'); $my_query = new WP_Query($args1); ?> <h2 class="entry-headline"><span class="entry-headline-text"><?php echo $title; ?> </span></h2> <div class="flexslider"> <ul class="slides"> <?php if ($my_query->have_posts()) { while ($my_query->have_posts()) { $my_query->the_post(); ?> <li><?php if (has_post_thumbnail()) { ?> <a title="<?php the_title(); ?> " href="<?php echo get_permalink(); ?> "><?php the_post_thumbnail('slider-thumb'); ?> </a><?php } ?> <a class="slider-link" title="<?php the_title(); ?> " href="<?php echo get_permalink(); ?> "><?php brickyard_short_title(); ?> </a></li> <?php } } wp_reset_query(); ?> </ul> </div> </section> <?php echo $after_widget; }
function widget($args, $instance) { // outputs the content of the widget extract($args); $title = apply_filters('widget_title', $instance['title']); $category = apply_filters('widget_category', $instance['category']); $numberposts = apply_filters('widget_numberposts', $instance['numberposts']); echo $before_widget; ?> <section class="home-grid-posts"> <?php $args1 = array('cat' => $category, 'showposts' => $numberposts, 'post_type' => 'post', 'post_status' => 'publish'); $my_query = new WP_Query($args1); ?> <h2 class="entry-headline"><span class="entry-headline-text"><?php echo $title; ?> </span></h2> <div class="home-grid-posts-wrapper"> <?php if ($my_query->have_posts()) { while ($my_query->have_posts()) { $my_query->the_post(); ?> <article class="post-entry post-entry-grid"> <?php if (has_post_thumbnail()) { ?> <a title="<?php the_title(); ?> " href="<?php echo get_permalink(); ?> "><?php the_post_thumbnail('grid-thumb'); ?> </a><?php } ?> <h2 class="post-entry-headline"><a title="<?php the_title(); ?> " href="<?php echo get_permalink(); ?> "><?php brickyard_short_title(); ?> </a></h2> <p class="post-meta"> <span class="post-info-date"><a href="<?php echo get_permalink(); ?> "><?php echo get_the_date(); ?> </a></span> <?php if (comments_open()) { ?> <span class="post-info-comments"><a href="<?php comments_link(); ?> "><?php printf(_n('1 Comment', '%1$s Comments', get_comments_number(), 'brickyard'), number_format_i18n(get_comments_number()), get_the_title()); ?> </a></span> <?php } ?> </p> <p><a href="<?php echo get_permalink(); ?> " class="read-more-link"><?php _e('Read more >', 'brickyard'); ?> </a></p> </article> <?php } } wp_reset_query(); ?> </div> </section> <?php echo $after_widget; }