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?
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo friendly links.The code that ive used many times before.....Code: $_SESSION['lang'] = $lang =
first few characters only
hi, does anyone know how to use PHP to take the first few words of a text and limit them? i have seen this in many news sites where the news story headline reads like "woman found in obama's
PECL uploadprogress for php5.2
Hey, I just installed PHP5 via .htaccess on my 1and1 Shared Hosting Account.How would I exactly install the "PECL uploadprogress"?http://pecl.php.net/package/uploadprogress---There are
firefox wouldnt stream mp3 files completely from my php page
hi everyone,I have a php file trying to read and stream mp3 files. It works fine in IE but my problem is Firefox streams only 3 seconds of them.$direction =
WM transfer order: confirm different batch than proposed by system
Hi folks,
Header is not working in IE
Hi ! header function is not working in IE but it works in FF, Safari, Chrome. any help please. :if (isset($_POST['sub1'])) { $id = $_POST['cscstest']; $qty = $_POST['cscsqty']; $id =
How to disable direct access to a file
Suppose I've 2 Files. 1.php & 2.php I don't want anybody to access 2.php directly from browser. Eg: http://localhost/2.php but I want 2.php show up in 1.php like:Line number On/Off |
Problem with php's rename function
So, i'm having a problem with the php rename function. Basically my script 'delete_user.php' attempts to copy the users xml file(i stored all users information, in xml files as a backup of my
Making multiple rows with one query
I have a table called efed_handler_characters with two fields handler_id and bio_id. What query 2 is supposed to do is get the id from the handler and then with each char(acter) is supposed to make a
Help with echo()
I'm having some problems with this code:Code: echo ' <A