我的客户希望他的新闻页面上有3列和3篇文章。
每一列都有标题名称、日期、摘录和阅读更多功能。
像这样:http://rikvandoorn.nl/nieuws_pagina.jpg
由于我的PHP知识不是很好,我正在寻找一些教程来创建3列页面。但所有这些教程都过时了,缺乏信息,或者它们似乎没有那么好用。
并且"留下回复"可以移动到single.php。
所以我希望你们中的一些人能给我一些帮助。
这是我当前的内容。php
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="aside">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
</div><!-- .aside -->
<footer class="entry-meta">
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php echo get_the_date(); ?></a>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
</div><!-- .comments-link -->
<?php endif; // comments_open() ?>
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- .entry-meta -->
</article><!-- #post -->
设置wordpress循环
<?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="aside">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'twentytwelve' ) ); ?>
</div><!-- .entry-content -->
</div><!-- .aside -->
<?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
</article><!-- #post -->
<?php endwhile; endif; wp_reset_query(); ?>
然后在管理员中转到"设置">"常规">"阅读"-在"博客页面最多显示"中选择3