2013-07-08 48 views
0

我的客户希望他的新闻页面有3列和3个帖子在页面上。3列布局wordpress(页面上的3篇文章)

每列都有一个标题名称,日期,摘录和阅读更多功能。

喜欢这个:http://rikvandoorn.nl/nieuws_pagina.jpg

因为我的PHP知识不是那么好,我一直在寻找一些教程创建3列页面。但那些教程已经过时了,缺乏信息,或者它们看起来不太好。

而“留下回复”可以移动到single.php。

所以我希望你们中的一些人能为我提供一些帮助。

这是我目前content.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">&rarr;</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 --> 
+0

你的CSS看起来像什么?你只是问如何像链接的图像一样设置页面的样式? –

+0

造型的页面似乎并不难。我在寻找的是创建该布局所需的php脚本(在functions.php中),所以每当添加新帖子时,只有布局正在更新内容。随着多个页面的可能性 – Rik

+1

检查[此搜索结果](http://wordpress.stackexchange.com/search?q=%2Bpost+%2Bcolumns+%2Blayout)。 – brasofilo

回答

0

设置WordPress的loop

<?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">&rarr;</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最多'