...

View Full Version : Hi newbie here, need some php help



inokostandini
02-24-2010, 08:27 PM
Hi there guys this is my first. I have a small problem with my blog http://www.carinstructions.com with the featured posts in the main page. What happen is that when i have more than 2 posts in the featured gallery is doesn't show the right picture for the right post in the featured post. Ill post here the main index code and i hope ill get some help. Somebody help please.



<?php get_header(); ?>

<!-- BEGIN content -->
<div id="content"><div class="head"><div class="foot">

<?php
$tmp_query = $wp_query;
query_posts('showposts=3&cat=' . get_cat_ID(dp_settings('featured')));
if (have_posts()) :
$first = true;
while (have_posts()) : the_post();
ob_start();
?>
<li<?php if ($first) echo ' class="first"'; ?>><a href="<?php the_permalink(); ?>"><?php dp_attachment_image($post->ID, 'full', 'alt="' . $post->post_title . '"'); ?></a></li>
<?php
$photos .= ob_get_clean();
ob_start();
?>
<li<?php if ($first) echo ' class="first"'; ?>>
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<p><?php echo dp_clean($post->post_content, 260); ?></p>
<a href="<?php the_permalink(); ?>" class="readmore">Read Full Story</a>
</li>
<?php
$text .= ob_get_clean();
$first = false;
endwhile;
endif;
?>

<!-- begin featured -->
<div class="featured">
<h2 class="title">Featured Posts</h2>
<div class="thumb"><div class="b">
<ul class="photo">
<?php echo $photos; ?>
</ul>
<ul class="text">
<?php echo $text; ?>
</ul>
</div></div>
</div>
<!-- end featured -->

mlseim
02-24-2010, 11:34 PM
They all look OK to me ...
Which pictures are wrong?
Or did you fix it?

inokostandini
02-24-2010, 11:41 PM
No i didn't because im not good with php. If you see the featured post in the main page when it switches from :
1 . Fuel Saving Secrets post the picture is correct but the next one
2. Buiyng a used car it shows the wrong picture, it shows the picture of the third post
3. How to get a free carfax.

Thank you for your time.

masterofollies
02-25-2010, 12:05 AM
I see what you mean. The easiest way to fix it is to convert the whole thing to one image, but of course that isn't what you want.

I am assuming this is a flash script, instead of a random change, do it in order and loop with, using the correct text with it.

Courtney
02-25-2010, 12:13 AM
Is the second image even available?

inokostandini
02-25-2010, 05:40 PM
Is the second image even available?

Yes it is.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum