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?
image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnail and put it into one directory and save the original file into another, but it seems that when
When file included, REMOTE_ADDR is server's?
I have an index file that handles my site, basically index.php?page=ip will activate "require('./ip.php')".In the included file I have $ip = $_SERVER['REMOTE_ADDR']; and when it FIRST
Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are ticked then I want it to display all vehicle roof heights. However it doesn't work correctly, for
ImageCreate()
When I create an image and add text to it I want my text to be replaced with a PNG image, because the PNG image has text effects. I have an image of every letter I just don't know if this is possible
Header redirect
Hello ive got a problem ive got form with its action set to itself.Code: <form id="formID" class="formular" method="post" action=""/>it then runs
PHP5 - Verifying a secure mail is secure
I need to send an e-mail from a form to a external department and because it contains personal customer information, it must be secure.
Help with setcookie()
Merry Xmas to those on this foruumOlder guy here with some experience but not allot so please be gentle.I am having problems with setting cookies on my web site. At one time they worked and for the
mysql UNION | warning mysql_fetch_array !!
Code: <?php $i = 0; $query1="SELECT * FROM `products` WHERE `division`='$f_usr_div' ORDER BY `pname` UNION SELECT `stock_close` FROM `stockiest_entry` WHERE
Quick Syntax Question
Hi folks,I'm getting the following error: "unexpected T_LNUMBER". I'm trying to build a dynamic table in PHP it was working great until I attempted to include a java reference in one of my
How can use this array as a key?
Say I have this array for example:print_r($array);Prints:Code: [Select]Array( [0] => Array ( [status] => 0 ) [1] => Array (