コード例 #1
0
    /**
     * Front-end display of widget.
     *
     * @see WP_Widget::widget()
     *
     * @param array $args     Widget arguments.
     * @param array $instance Saved values from database.
     */
    public function widget($args, $instance)
    {
        $title = !empty($instance['title']) ? $instance['title'] : __('New title', TEXTDOMAIN);
        $query_args = array('post_type' => 'jetpack-testimonial', 'posts_per_page' => 3);
        $query = new \WP_Query($query_args);
        if (!$query->have_posts()) {
            return;
        }
        echo wp_kses($args['before_widget'], 'post');
        scroll_point('row-fluid');
        ?>
<div id="testimonials-wrapper">
	<?php 
        echo wp_kses($args['before_title'] . $title . $args['after_title'], 'post');
        ?>
	<div class="container row-fluid">
		<?php 
        while ($query->have_posts()) {
            $query->the_post();
            ?>
		<div id="testimonial<?php 
            the_ID();
            ?>
" <?php 
            post_class('testimonial span4');
            ?>
>
			<?php 
            get_template_part('template-parts/loop', 'single-jetpack-testimonial');
            ?>
		</div>
		<?php 
        }
        ?>
	</div>
</div>
<?php 
        echo wp_kses($args['after_widget'], 'post');
    }
コード例 #2
0
<?php

/*
 * Template Name: Default
 */
__('Default', TEXTDOMAIN);
the_post();
get_header();
get_template_part('template-parts/header');
get_template_part('template-parts/banner');
?>
<div id="middle-wrapper">
    <div id="content-wrapper" class="container">
        <?php 
scroll_point('row-fluid');
?>
        <div id="content-header" class="row-fluid">
            <div class="span4">
                <?php 
the_post_thumbnail(null, array('class' => 'img-fit'));
?>
            </div>
        	<div id='content-main' class='page-<?php 
the_ID();
?>
 group span4' role='main'>
        		<input type="hidden" value="<?php 
the_ID();
?>
" name="content-id" id="content-id" />
				<input type="hidden" value="page" name="post-type" id="post-type" />
コード例 #3
0
    <div id="content-wrapper" class="container">
        <div id="content-header" class="row-fluid">
        	<div id='content-main' class='archive-<?php 
get_post_type();
?>
-<?php 
the_ID();
?>
 group span12' role='main'>
            	<input type="hidden" value="archive-<?php 
get_post_type();
?>
" name="post-type" id="post-type" />
            	<div id="content" class="clearfix">
            		<?php 
scroll_point();
?>
            		<h1 class="hidden"><?php 
esc_html_e('Search results', TEXTDOMAIN);
?>
</h1>
					<ul class="unstyled">  
						<?php 
while (have_posts()) {
    the_post();
    ?>
							<li <?php 
    post_class();
    ?>
>
							<?php