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

02-24-2010, 09: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">

$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();
<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>
$photos .= ob_get_clean();
<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>
$text .= ob_get_clean();
$first = false;

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

02-25-2010, 12:34 AM
They all look OK to me ...
Which pictures are wrong?
Or did you fix it?

02-25-2010, 12:41 AM
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.

02-25-2010, 01: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.

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

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

Yes it is.