HTML,CSS,PHP,ワードプレスカスタマイズ 技術情報資料

shortcodes-ultimate ギャラリーなどの書式

2015y06m01d_231616814
「投稿」の書式変更。
プラグインのフォルダーの中の template/ 配下にテンプレートのひな形があるので、それをカスタマイズ。
例えば立並びの新着などは、以下のようにしてやればよい。
<div class="su-posts su-posts-single-post">
	<?php
		// Prepare marker to show only one post
		$first = true;
		// Posts are found
		if ( $posts->have_posts() ) {
			while ( $posts->have_posts() ) :
				$posts->the_post();
				global $post;

				// Show oly first post
				if ( $first ) {
					$first = false;
					?>
					<div id="su-post-<?php the_ID(); ?>" class="su-post">
						<div class="su-post-meta">
							<?php the_time( get_option( 'date_format' ) ); ?> 
							<?php the_title(); ?>
							<span style="padding:0 0 0 15px;">≫
							<a href="<?php comments_link(); ?>" class="su-post-comments-link">
								<?php echo mb_substr(strip_tags(apply_filters('the_content', $post->post_content)), 0, 120); ?>
							</a>
							</span>
						</div>
					</div>
					<?php
				}
			endwhile;
		}
		// Posts not found
		else {
			echo '<h4>' . __( 'Posts not found', 'su' ) . '</h4>';
		}
	?>
</div>
 
日付 タイトル ≫ 記事・・・
日付 タイトル ≫ 記事・・・
日付 タイトル ≫ 記事・・・
こんな感じで表示される。

スポンサーリンク

スポンサーリンク

カテゴリー