Community Forums › Forums › Design Tips and Tricks › How to make a 2-column archive page
This topic contains 5 replies, has 2 voices, and was last updated by Hard Boiled Greg 5 months ago.
-
AuthorPosts
-
December 17, 2012 at 5:47 pm #5829
Hi, I’m using the news theme, and on my archive page there are 2 columns – one column has authors, categories, etc and the other column has recent posts. What I’d like to do is keep the 2 columns but use them BOTH for posts – say, 20 posts on the left and the next 20 on the right. I don’t know enough php to do that so would anyone be able to tell me how I can get my archive page to “get posts” then essentially “get more posts”? So I end up with say, the 40 most recent posts split in 2 columns. Thank you!
December 22, 2012 at 4:57 pm #7052December 22, 2012 at 6:30 pm #7069This is my archive page.
http://www.websearchsocial.com/archives
I’d like to have all recent articles – 25 and 25. Thanks!
December 22, 2012 at 7:24 pm #7079Thanks for the link DigitalC! Wrapping a few presents right now; I’ll be back a bit later with some suggestions for you.
HBG
Website: Hard Boiled Greg Twitter: @hbgreg
December 22, 2012 at 9:37 pm #7086OK, the Archive template is using the “wp_get_archives” function which apparently doesn’t have an offset, so we’ll have to “get_posts” instead.
We don’t want to edit the parent theme files so copy the “page_archive.php” file from your genesis folder and paste it into your child theme. Then replace this section in that file (lets try a pastie) :
<div class=”archive-page”>
<h4></h4>
<ul>
</ul><h4></h4>
<ul>
</ul></div><!– end .archive-page–>
<div class=”archive-page”>
<h4></h4>
<ul>
</ul><h4></h4>
<ul>
</ul><h4></h4>
<ul>
</ul></div><!– end .archive-page–>
With this:
<div class=”archive-page”>
<h4></h4>
<ul>
<!–?php global $post; $args = array( ‘numberposts’ => 25 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href=”“></a></li>
</ul></div><!– end .archive-page–>
<div class=”archive-page”>
<h4></h4>
<ul>
<!–?php global $post; $args = array( ‘numberposts’ => 25, ‘offset’=> 25 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<li><a href=”“></a></li>
</ul>
</div><!– end .archive-page–>Let me know how it works out for you.
HBG
Website: Hard Boiled Greg Twitter: @hbgreg
-
This reply was modified 5 months ago by
Hard Boiled Greg. Reason: pastie didn't work
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg. Reason: Good grief we need a better way to paste code
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg. Reason: pastie didn't work
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg. Reason: Good grief we need a better way to paste code
-
This reply was modified 5 months ago by
Hard Boiled Greg.
December 22, 2012 at 9:44 pm #7092–Extra Post– please delete
Website: Hard Boiled Greg Twitter: @hbgreg
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
Hard Boiled Greg.
-
This reply was modified 5 months ago by
-
AuthorPosts
You must be logged in to reply to this topic.