示例#1
0
</small>
								</p>
							</div>
							<div class="news-v2-desc">
								<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
								<small>By <?php 
        the_author_link();
        ?>
 | In <?php 
        echo ocp_post_tax($post->ID, 'category');
        ?>
</small>
								<?php 
        the_excerpt();
        ?>
							</div>
						</div>
						<?php 
        $i++;
    }
    wp_reset_query();
    ?>
					</div>
					<!-- End News v2 -->
					<?php 
示例#2
0
    public function widget($args, $instance)
    {
        echo $args['before_widget'];
        if (!empty($instance['title'])) {
            echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
        }
        $style = get_field('style', get_option('page_for_posts'));
        $limit = get_field('limit', 'widget_' . $args['widget_id']);
        $cats = get_field('categories', 'widget_' . $args['widget_id']);
        $loop_args = array('post_type' => 'post', 'posts_per_page' => $limit);
        if ($cats) {
            $loop_args['cat'] = $cats;
        }
        $posts = get_posts($loop_args);
        if ($posts) {
            if ($style == 'basic') {
                $output = '<div class="posts margin-bottom-40">';
                foreach ($posts as $post) {
                    setup_postdata($post);
                    $output .= '<dl class="dl-horizontal">
									<dt><a href="' . get_permalink($post->ID) . '">' . get_the_post_thumbnail($post->ID, 'feed-thumbs') . '</a></dt>
									<dd>
										<p><a href="' . get_permalink() . '">' . get_the_title($post->ID) . '</a></p> 
									</dd>
								</dl>';
                }
                $output .= '</div>';
                wp_reset_postdata();
            } else {
                $output = '<ul class="list-unstyled blog-trending margin-bottom-50">';
                foreach ($posts as $post) {
                    setup_postdata($post);
                    $output .= '<li>
									<h3><a href="' . get_permalink($post->ID) . '">' . get_the_title($post->ID) . '</a></h3>
									<small>' . get_the_time('j M, Y', $post->ID) . ' / ' . ocp_post_tax($post->ID, 'category') . '</small>
								</li>';
                }
                $output .= '</ul>';
                wp_reset_postdata();
            }
            echo $output;
        }
        echo $args['after_widget'];
    }
示例#3
0
            ?>
"><?php 
            the_title();
            ?>
</a></h3>
                    <small>By <?php 
            the_author();
            ?>
 | <a class="color-inherit" href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number();
            ?>
</a> | In <?php 
            ocp_post_tax($post->ID, $cat);
            ?>
</small>
                    <p><?php 
            the_excerpt();
            ?>
</p>
                </div>
            </div>
			<?php 
        }
        wp_reset_query();
        ?>
        </div>
		<?php 
    }
示例#4
0
                    <?php 
the_content();
?>
                </div>
                <div class="col-sm-4">
                    <div class="headline"><h2>Product Details</h2></div>
                    <ul class="list-unstyled project-details">
						<?php 
the_conditional_field('client', '<li><strong>Client:</strong> ', '</li>');
?>
						<?php 
the_conditional_field('date', '<li><strong>Date:</strong> ', '</li>');
?>
						<?php 
if (ocp_post_tax($post->ID, 'portfolio_cat') !== '') {
    echo '<li><strong>Categories:</strong> ' . ocp_post_tax($post->ID, 'portfolio_cat') . '</li>';
}
?>
						<?php 
the_conditional_field('link', '<li><strong>Website:</strong> <a href="', '" target="_blank">');
the_conditional_field('link', '', '</a></li>');
?>
                    </ul>
                </div>
            </div>        
            
			<?php 
$args = portfolio_query();
$loop = new WP_Query($args);
if ($loop->have_posts()) {
    $params = array(474, 300, 'bfi_thumb' => true);