コード例 #1
0
function get_home_recent($cat_data)
{
    $exclude = $Posts = $Box_Title = $pagination = $offset = '';
    if (!empty($cat_data['exclude'])) {
        $exclude = $cat_data['exclude'];
    }
    if (!empty($cat_data['number'])) {
        $Posts = $cat_data['number'];
    }
    if (!empty($cat_data['title'])) {
        $Box_Title = $cat_data['title'];
    }
    if (!empty($cat_data['display'])) {
        $display = $cat_data['display'];
    }
    if (!empty($cat_data['pagi'])) {
        $pagination = $cat_data['pagi'];
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    $args = array('posts_per_page' => $Posts, 'category__not_in' => $exclude, 'offset' => $offset, 'ignore_sticky_posts' => 1);
    if (!empty($pagination) && $pagination == 'y') {
        $args['paged'] = get_query_var('paged');
    } else {
        $args['no_found_rows'] = 1;
    }
    $cat_query = new WP_Query($args);
    ?>
		<section class="cat-box recent-box">
			<div class="cat-box-title">
				<h2><?php 
    if (function_exists('icl_t')) {
        echo icl_t(theme_name, $cat_data['boxid'], $Box_Title);
    } else {
        echo $Box_Title;
    }
    ?>
</h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
    if ($cat_query->have_posts()) {
        ?>

				<?php 
        while ($cat_query->have_posts()) {
            $cat_query->the_post();
            ?>
				<?php 
            if ($display == 'blog') {
                ?>
					<article <?php 
                tie_post_class('item-list');
                ?>
>
						<h2 class="post-box-title"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h2>
						<?php 
                get_template_part('includes/boxes-meta');
                ?>
					

						<?php 
                if (tie_get_option('blog_display') == 'content') {
                    ?>
						<div class="entry">
							<?php 
                    the_content(__('Read More &raquo;', 'tie'));
                    ?>
						</div>
						
						<?php 
                } else {
                    ?>
						
							<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
						<div class="post-thumbnail">
							<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark">
								<?php 
                        the_post_thumbnail('thumbnail');
                        ?>
								<span class="overlay-icon"></span>
							</a>
						</div><!-- post-thumbnail /-->
							<?php 
                    }
                    ?>
									
						<div class="entry">
							<p><?php 
                    tie_excerpt();
                    ?>
							<a class="more-link" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More &raquo;', 'tie');
                    ?>
</a></p>
						</div>
						<?php 
                }
                ?>
						
						<?php 
                if (tie_get_option('archives_socail')) {
                    get_template_part('includes/post-share');
                }
                // Get Share Button template
                ?>
					</article><!-- .item-list -->
				<?php 
            } else {
                ?>
					<div <?php 
                tie_post_class('recent-item');
                ?>
>
						<?php 
                if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                    ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark">
									<?php 
                    tie_thumb('tie-medium');
                    ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                }
                ?>
			
						<h3 class="post-box-title"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h3>
						<p class="post-meta">
							<?php 
                if (tie_get_option('box_meta_score')) {
                    tie_get_score();
                }
                ?>
							<?php 
                if (tie_get_option('box_meta_date')) {
                    tie_get_time();
                }
                ?>
						</p>
					</div>
				<?php 
            }
            ?>
				<?php 
        }
        ?>
				<div class="clear"></div>

			<?php 
    }
    ?>
			</div><!-- .cat-box-content /-->
		</section>
		<?php 
    if (!empty($pagination) && $pagination == 'y' && empty($offset) && $cat_query->max_num_pages > 1) {
        ?>
 <div class="recent-box-pagination"><?php 
        tie_pagenavi($cat_query, $Posts);
        ?>
 </div> <?php 
    }
    ?>
		<div class="clear"></div>
<?php 
}
コード例 #2
0
ファイル: index.php プロジェクト: fedeB-IT-dept/fedeB_website
// Get Slider template
?>

<div class="content">
	<?php 
if (tie_get_option('slider_pos') != 'big') {
    get_template_part('includes/slider');
}
// Get Slider template
?>

	<?php 
if (tie_get_option('on_home') != 'boxes') {
    get_template_part('loop', 'index');
    if ($wp_query->max_num_pages > 1) {
        tie_pagenavi();
    }
} else {
    $cats = get_option('tie_home_cats');
    if ($cats) {
        foreach ($cats as $cat) {
            tie_get_home_cats($cat);
        }
    } else {
        _e('You can use Homepage builder to build your homepage', 'tie');
    }
    tie_home_tabs();
}
?>
		
</div><!-- .content /-->
コード例 #3
0
ファイル: page-gia-su.php プロジェクト: hongtien510/gia_su
                the_author_posts_link();
                ?>
</strong></div>
				<?php 
            }
            ?>
				
				<?php 
            //if( tie_get_option( 'share_buttons_pages' ) && tie_get_option( 'share_post' ) && ( !function_exists( 'is_buddypress' ) || ( function_exists( 'is_buddypress' ) && !is_buddypress() ) ) ) get_template_part( 'framework/parts/share' ); // Get Share Button template
            ?>
				<div class="clear"></div>
			</div><!-- .post-inner -->
		</article><!-- .post-listing -->
        <?php 
            if ($wp_query->max_num_pages > 1) {
                tie_pagenavi(false, false, "trang");
            }
            wp_reset_query();
            ?>
		<?php 
        }
    }
    ?>
		
		<?php 
    //Below Post Banner
    if (empty($get_meta["tie_hide_below"][0])) {
        if (!empty($get_meta["tie_banner_below"][0])) {
            echo '<div class="e3lan e3lan-post">' . htmlspecialchars_decode($get_meta["tie_banner_below"][0]) . '</div>';
        } else {
            tie_banner('banner_below', '<div class="e3lan e3lan-post">', '</div>');
コード例 #4
0
				<?php 
        }
        ?>
	
					
					
			<?php 
    }
    ?>
			
			
			
				<div class="clear"></div>
			<?php 
}
?>
			
			</div><!-- .cat-box-content /-->
		</section>
		<?php 
if (!empty($pagination) && empty($block['offset']) && $cat_query->max_num_pages > 1) {
    ?>
 <div class="recent-box-pagination"><?php 
    tie_pagenavi($cat_query, $block['number']);
    ?>
 </div> <?php 
}
?>
		<div class="clear"></div>
		<?php 
wp_reset_query();
    /**
     * Print the podcasts with tabs for hourly and segment audio
     * 
     * @since   1.2.0
     */
    public static function display_podcasts_with_tabs($hourly_atts, $segment_atts)
    {
        ob_start();
        echo '<div class="podcast_bin">';
        echo '  <div class="podcast_placeholder"></div>';
        echo '<div class="podcast_tabs">Select an audio category: ';
        echo '<div class="podcast_tab" data-segment="segments">Segment Audio</div>';
        echo '<div class="podcast_tab" data-segment="hourly">Hourly Audio</div>';
        echo '</div>';
        echo '  <div class="podcasts">';
        if (isset($_GET['podcast_tab']) && ($_GET['podcast_tab'] == 'segments' || $_GET['podcast_tab'] == 'hourly')) {
            ?>
                    <style>
                        #segments, #hourly { display: none; }
                        #<?php 
            echo esc_attr($_GET['podcast_tab']);
            ?>
 { display: block; }
                    </style>
                    <?php 
        } else {
            ?>
                    <style>
                        #segments, #hourly { display: none; }
                        #segments { display: block; }
                    </style>
                    <?php 
        }
        echo '<div id="hourly">';
        $hourly_clips = new WP_Query($hourly_atts);
        if ($hourly_clips->have_posts()) {
            while ($hourly_clips->have_posts()) {
                $hourly_clips->the_post();
                $post_segment = wp_get_post_terms(get_the_ID(), 'podcast_segment');
                $soundcloud_embed = do_shortcode(get_post_meta(get_the_ID(), 'soundcloud-shortcode', TRUE));
                $soundcloud_embed = str_replace('&visual=true', '', $soundcloud_embed);
                $soundcloud_embed = str_replace('&amp;visual=true', '', $soundcloud_embed);
                ?>
                            <a class="podcast" href="<?php 
                the_permalink();
                ?>
" data-soundcloud_embed="<?php 
                echo htmlentities($soundcloud_embed);
                ?>
"">
                                <div class="podcast_segment"><?php 
                echo $post_segment[0]->name;
                ?>
</div>
                                <div class="podcast_title"><?php 
                the_title();
                ?>
</div>
                            </a>
                            <?php 
            }
        }
        wp_reset_query();
        wp_reset_postdata();
        echo '</div>';
        echo '<div id="segments">';
        $segment_clips = new WP_Query($segment_atts);
        if ($segment_clips->have_posts()) {
            while ($segment_clips->have_posts()) {
                $segment_clips->the_post();
                $post_segment = wp_get_post_terms(get_the_ID(), 'podcast_segment');
                $soundcloud_embed = do_shortcode(get_post_meta(get_the_ID(), 'soundcloud-shortcode', TRUE));
                $soundcloud_embed = str_replace('&visual=true', '', $soundcloud_embed);
                $soundcloud_embed = str_replace('&amp;visual=true', '', $soundcloud_embed);
                ?>
                            <a class="podcast" href="<?php 
                the_permalink();
                ?>
" data-soundcloud_embed="<?php 
                echo htmlentities($soundcloud_embed);
                ?>
">
                                <div class="podcast_segment"><?php 
                echo $post_segment[0]->name;
                ?>
</div>
                                <div class="podcast_title"><?php 
                the_title();
                ?>
</div>
                            </a>
                            <?php 
            }
        }
        wp_reset_query();
        wp_reset_postdata();
        echo '</div>';
        echo "</div>";
        echo "</div>";
        if (is_home()) {
            echo '<div class="pagination"><span id="tie-next-page"><a class="load_more_audio" style="font-weight: bold; font-size: 120%; text-align: center; border-bottom: 1px solid #D8D8D8; margin: 0px auto; display: block; width: 100%;" href="/podcasts/">More Audio</a></span></div>';
        }
        if (is_single() || is_page()) {
            echo tie_pagenavi($podcasts, 5);
        }
    }