I have various pages with multiple loops and i need them to be individual to all other categories.
2 columns.
Left column shows 4 posts from category news just with the date and some custom information.
Right column, on the home page shows the latest post and every other page shows the post content from the one you have just clicked on in the left column, all the full post content appears there, with the left column still showing the latest posts still.
These two elements need to ignore all other categories and posts.
I have been using this multiple loop code, on both the news page and single page.
Code: [Select]<?php
/**
* @package WordPress
* @subpackage Starkers
*/
get_header();
?>
<?php get_sidebar(); ?>
<div id="grid_2">
<div id="news_links">
<ul>
// Get the last 3 posts in the featured category.
<?php query_posts('category_name=news&showposts=4'); ?>
<?php while (have_posts()) : the_post(); $data = get_post_meta( $post->ID, 'key', true );?>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<span>
<li><?php the_time('F jS, Y') ?></li>
<li><?php the_title(); ?></li>
<li><?php echo $data[ 'place' ]; ?></li>
<li><?php echo $data[ 'location' ]; ?></li>
</span>
</a>
<?php endwhile ?>
</ul>
</div>
<!--news_links-->
<div class="clearFix"><!--x--></div>
</div>
<!--grid_2-->
//We reset the loop
<?php rewind_posts(); ?>
<div id="grid_3">
<?php if (have_posts()) : ?>
<?php query_posts('category_name=news&showposts=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<?php the_content('Read the rest of this entry »'); ?>
<p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?> <?php comments_popup_link('No Comments &#187;', '1 Comment &#187;', '% Comments &#187;'); ?></p>
</div>
<?php endwhile; ?>
<?php next_posts_link('« Older Entries') ?> | <?php previous_posts_link('Newer Entries »') ?>
<?php else : ?>
<h2>Not Found</h2>
<p>Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>
<?php endif; ?>
<div class="clearFix"><!--x--></div>
</div>
<!--grid_3-->
The problem i have is that regardless of which post you click on in the left column it always shows the same post in the right column, the most recent one, not the one you have just clicked on!
I think its something to do with this..
Code: [Select]<?php query_posts('category_name=news&showposts=1'); ?>
As its been told to show 1 post and its showing the most recent one.
Any idea how i can get it to show just the post you have clicked on in the right column?
Help please - How to validate from 2 possible answers
Hi I hope somebody can help me with what will probably be really simple, I'm pulling my hair trying to get my head round it.I've got a contact form and I would like to add to it a couple of simple
Limiting uploaded file type
I am working on a simple upload script, and I need it to limit the allowed file type that is uploaded to only .mpr files. .mpr files are not a MIME file type so I do not know how to limit it. Any
query based on 2 conditions
I want to select if the doc_type is either s OR f but this doesn't work:Code: [Select]$query2 = "SELECT * FROM members WHERE doc_type='s' && doc_type= 'f' ORDER BY
help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "Archives" section at http://www.simonlindgren.com ?The code surrounding this place
Strange PHP/mySQL error ... am I just tired?
Code: <?## CONNECT TO DB FUNCTION!function ConnectTo($db2con){ $hostName = "localhost"; $dbName = "people_".$db2con; $userName = "people_main"; $password =
What is SAP Avatar ?
Hi All,
checkbox update
I am having a brain fart right now and i cant remember how to do this. if anyone could help that would be great. I have search google and this forum but have not found what i am looking for.thankswhen
how to use two buttons with php
hi i have one form. there are three fields which are to be filled by the user. and then there are two buttons. ob clicking first button i want to save user's provided data to the database display the
MySQL Primary key gap
Alright, so I have a table with 26 entries in it (id, filename, caption) for my image randomiser (http://zeroerror.co.uk/community_img.php) which is working fine, technically, but I have a slight
New to PHP and just trying to understand a little code.
I hope I'm not annoying anyone or breaking the rules but I was wondering about this bit of code right here: " <?php$people = Array(Array('name' => 'Kalle', 'salt' =>