Forums

all single post pages displaying content and title of fist post ?? (2 posts)

  1. jmizi
    Member
    Posted 2 years ago #

    Hey, Im really confused.
    So I have multiple single.php templates and there are synced up to different category archive pages via the main single.php.
    Thats all good and dandy.
    I ran into a problem, that for all the post the_title and the_content tags are grabbing the info from my fist post in that category.
    ie I have 3 posts under the portfolio category, but the last 2 posts are grabbing the title and content info from the first post... Everything else like the wp_title and the custom fields i have are all pulling from the appropriate post.

    So whats the deal?? I'm cant figure this one out. Here is the main part of the single template where all the action is happening.

    <div class="section">
    <h1>Portfolio</h1>
    
    <?php // if there's project_image
    if($project_image !== '') { ?>
    <img class="project-image" src="images/<?php echo $project_image; ?>.png" alt="Screenshot of the <?php single_post_title('Current post: '); ?> website" />
    <?php } //end if statement
    //if there's not project_image
    else {}
    ?>
    
    <div class="project-info">
    <h2><?php the_title(); ?></h2>
    <p><?php the_content(); ?></p>
    
    <p>
    Client: <?php echo $client; ?>
    
    <?php // if there's link_singular
    if($link_singular !== '') { ?>
    
    URL: " target="_blank" title="Visit project"><?php echo $link_singular_text; ?>
    
    <?php } //end if statement
    //if there's not link_singular
    else {}
    ?>
    
    </p>
    </div><!-- end project-info -->

    if I need to i can post more of the code.

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic