Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Hi newbie here, need some php help

    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 Code:
    <?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_content260); ?></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 -->
    Last edited by inokostandini; 02-24-2010 at 08:29 PM.

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,456
    Thanks
    8
    Thanked 1,084 Times in 1,075 Posts
    They all look OK to me ...
    Which pictures are wrong?
    Or did you fix it?

  • Users who have thanked mlseim for this post:

    inokostandini (02-24-2010)

  • #3
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    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.

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    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.
    Rowsdower! has accused me of having mental problems, and the administrator allowed it. What a great forum huh?

  • #5
    New Coder
    Join Date
    Feb 2010
    Posts
    20
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Is the second image even available?

  • #6
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Courtney View Post
    Is the second image even available?
    Yes it is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •