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?
ASP.NET 2.0 - Enter Key - Default Submit Button
Hi,One of the most annoying things in developing web pages is handling the "Enter key" for form submission. Enter key has been the favourite way users like to submit forms. Though we provide Buttons
help with contest script
I would like to code a contest script to my site but i don't know how. Could someone just give me push in the right direction?
Progress bar tracking file downloads
Hey guys, was wondering if there was a way to track how far a file has been downloaded. I know there is a way to track uploading with APC and php 5.2 + ?? any suggestions thanks
Code Review - SQL and Insertion Attacks (Warning: Not for Newbs)
Hey guys,Its been a while, I know. Use to love coming here to answer peoples questions, but work and school have been keeping me too busy but do anything but lurk. I usually write all my code/apps by
Echoing If Function?
A script I am using has If statements in the comments form to basically tell the form what to do. Currently the form works by opening in a pop up for those who want to read/write comments. I'm
passing data from one page to another
hey guysi have the follwoing code to get information from one page and place on another:(1st page) page to get info from:Code: <?php session_start();$_SESSION['data'] = "blah blah
How to get the previous months last date....
Here's my wittle problem. I suck at working with dates.So today is 10/20/2009, i need to figure out how to useCode: $lastmonth = date("m-d-Y", strtotime(" "));in order to get
TinyMCE / Ajax Postback Problem
Hiya all,I have a page which loads the TinyMCE editor. On the postback I obviously want to fetch that data again but the value stays empty. Strangely enough, when I disable the "updatepanel" control I
insert/update functions for mysql, what do you think?
I am working on two really simple functions that automatically generate (and execute) insert and update mysql queries and I have some questions:Can there be any problems later on if functions treat
Optimize Code
Just started getting into the use of cookies. The following code will redirect users to a set URL should they view a preset number of pages. I'm a little concerned with the speed in which this