2013-07-08 83 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最多'