I want (i did) split the center column in two columns and want to fill it
I divided the centercolumn into two colomns, Have a look at http://newspiration.com/news/ of the home page horizontal, on the other pages vertical. I did this by pasting the div structure into the text area.
But now I want to show a different category on each static page, and to make it more complicated, the last post of this specific category should appear (in full) in the left column and the last 4 posts should appear (image exerpts or text exerpts) in the right column. For older posts of that specific category, you should somehow end up in the specific categorie archive. i used the technic offered here and changed the % to fixed withs. It all workes fine but now I want to fill the columns with posts. Any advice is apreciated. |
I found a piece of script that might be usefull? http://forum.bytesforall.com/showpos...93&postcount=2 and then maybe add the name of the div where it's suppost to show?
I don't know. |
You should create a new page template for this (covered a couple times on the forum here, or see http://codex.wordpress.org/Pages#Cre...Page_Templates ) with your HTML, then use the code from the thread you posted to hard code specific WP queries into the various sections of your page template.
Create a new page in WP without content, upload the page template to the Atahualpa directory, and on the drop down menu on the top right of Site Admin -> Pages -> Add New / Edit Write Panel choose the new page template as the template for the new page To create a page template, make a copy of Atahualpa's index.php, and modify if by removing unnecessary things, and by adding your DIV's. On top of the page template add its name as seen on http://codex.wordpress.org/Pages#Cre...Page_Templates |
Thanx Flynn, for the help. I've gotten somewhere, but my posts won't show up.
This is what I'm aiming at; http://newspiration.com/news/ and this is what I've created by making a new template; http://newspiration.com/news/test-new-index/ . and this is the code I've entered into the template; What am I missing? <?php /* Template Name: twocol_h */ ?> <?php /* get all options: */ include (TEMPLATEPATH . '/functions/bfa_get_options.php'); get_header(); ?> <div class="txtboxhome1"> <?php if ( is_page('217') ) { ?> <?php $my_query = new WP_Query('category_name=news&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); ?> This should display the latest post in category 'news' <?php endwhile; ?> <?php } ?> <?php /* If there are any posts: */ if (have_posts()) : $bfa_ata['postcount'] == 1; /* Postcount needed for option "1 first posts full posts" */ ?> </div> <div class="txtboxhome2"> <?php if ( is_page('217') ) { ?> <?php $my_query = new WP_Query('category_name=vip&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); ?> This should display an exerpt of 4 lines of the latest post in category 'vip' <?php endwhile; ?> <?php } ?> <br /><br /> <?php if ( is_page('217') ) { ?> <?php $my_query = new WP_Query('category_name=inspiration&showposts=1'); while ($my_query->have_posts()) : $my_query->the_post(); ?> This should display an exerpt of 4 lines of the latest post in category 'inspiration' <?php endwhile; ?> <?php } ?> <?php /* END of: If there are any posts */ else : /* If there are no posts: */ ?> <?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page. This can be edited at Atahualpa Theme Options -> Style & edit the Center column */ bfa_center_content($bfa_ata['content_not_found']); ?> <?php endif; /* END of: If there are no posts */ ?> <?php bfa_center_content($bfa_ata['center_content_bottom']); ?> </div> <?php get_footer(); ?> With regards, Sakshin |
Replace
This should display the latest post in category 'news' with i.e. <h3><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3><?php the_content(); ?> |
Yes, you are right. This works. Thanks a lot,
Sakshin. |
Sakshin,
I'm having a hard time doing a split. Can you expand on "I did this by pasting the div structure into the text area. " I'm assuming you had to create multiple loops... can you also explain how you did that? Thanks. |
Well, as I wrote, all I did the first time was paste the <div coll1></div> and <div coll2></div> into the text area of each page and gave CSS style info into the CSS panel from Atahualpa. It looked ok but is not really wordpress. So I went a bit further and made separate template files for different pages ond glued the above div stucture into these files, with the needed database requests in between.
Was this any helpfull? |
Here's a full example;
<div class="txtboxarchive1"> <p><h3>This weeks inspiration posts:</h3></p> <?php if ( is_page('') ) { ?> <?php $my_query = new WP_Query('category_name=news&showposts=4'); while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><?php the_title(); ?></h3> <?php the_excerpt(); ?> <br></br> <?php endwhile; ?> <?php } ?> <?php /* If there are any posts: */ if (have_posts()) : $bfa_ata['postcount'] == 1; /* Postcount needed for option "1 first posts full posts" */ ?> <?php if ( is_page('') ) { ?> <?php $my_query = new WP_Query('category_name=inspiration&showposts=4'); while ($my_query->have_posts()) : $my_query->the_post(); ?> <h3><?php the_title(); ?></h3> <?php the_content(); ?><br /> <?php endwhile; ?> <?php } ?> </div> <div class="txtbox_small"> <?php get_sidebar(''); ?> <?php /* END of: If there are any posts */ else : /* If there are no posts: */ ?> <?php /* This outputs the "Not Found" content, if neither posts, pages nor attachments are available for the requested page. This can be edited at Atahualpa Theme Options -> Style & edit the Center column */ bfa_center_content($bfa_ata['content_not_found']); ?> <?php endif; /* END of: If there are no posts */ ?> </div> <div class="clear"></div> <?php get_footer(); ?> :) |
All times are GMT -6. The time now is 01:47 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.