WordPress 및 부트 스트랩으로 내 사이트에 "articles"페이지를 만듭니다. 나는 그것을 찾고있다 : 모든 3 개의 기사 (란), 새로운 "줄"는 모두를 분리한다. 이 행, 제 1 조, 제 2 조, 제 3 조, 행, 새 행, 제 4, 제 5의 끝 ...X 열 뒤에 자동으로 행 만들기 WordPress
내 테마 워드 프레스를위한 스타터 테마를 만들 것 : 여기
은 밑줄 기사 요약을 생성하는 내 코드 (content.php 파일) :
이것은 완벽하게 작동하지만 내용은 끝없이 생성됩니다 (무한 루프).
<div class="row">
<?php $i = 1; while(have_posts()) : the_post();?>
<div class="col-sm-4 blog-resume">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header>
<a href="<?php echo get_permalink() ?>">
<div class="featured-image-blog" style="background-image: url('<?php echo get_the_post_thumbnail_url() ?>')"></div>
</a>
</header>
<div class="article-resume text-center">
<h2><a href="<?php echo get_permalink() ?>"><?php echo get_the_title() ?></a></h2>
<p class="posted-on">Posté le <?php echo the_date() ?></p>
<p class="resume-article"><?php echo the_content() ?></p>
</div>
</article>
</div>
<?php if ($i % 3 === 0) { echo '</div><div class="row">'; } ?>
<?php $i++; endwhile; wp_reset_query(); ?>
</div>
나는이의 index.php 파일을 생각 어디 content.php 김정일 전화, 여기의 index.php의 내용 : 여기
<div class="blog-part">
<div class="container">
<?php
if (have_posts()) :
if (is_home() && ! is_front_page()) : ?>
<header>
<h1 class="text-center"><?php single_post_title(); ?></h1>
</header>
<?php
endif;
/* Start the Loop */
while (have_posts()) : the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part('template-parts/content', get_post_format());
endwhile;
the_posts_navigation();
else :
get_template_part('template-parts/content', 'none');
endif; ?>
</div><!-- container -->
</div><!-- blog-part -->
<?php
get_sidebar();
get_footer();
.blog - 이력서
의 CSS.blog-resume {
margin-bottom: 20px;
margin-top: 20px;
}
.blog-resume > article {
background: #fff;
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
-webkit-box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14), 0 1px 5px 0 rgba(0,0,0,0.12), 0 3px 1px -2px rgba(0,0,0,0.2);
}
일종의 그리드 시스템을 사용해야합니다. 부트 스트랩과 CSS 그리드를 살펴보십시오. – FluffyKitten
내가 부트 스트랩을 사용하는 메시지에 지정했습니다. :) – Yann
글쎄, 그것을 사용하기위한 설명서를 참조하십시오 :) 당신이 여기에 게시하기 전에, 당신은 당신의 이슈를 조사하고 코드를 직접 작성하려고 시도했습니다. 필요한 모든 정보는 부트 스트랩 문서에 있습니다. 시도해보고 * 특정 *에 붙어 있다면 돌아와서 시도한 내용과 관련 코드를 포함 시키십시오. [Stack Overflow 사용자에 대한 연구 노력의 정도] (https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users) – FluffyKitten