PHP Wordpress Issue

Discussion in 'PHP' started by amit.wadhwa, Jul 18, 2012.

  1. #1
    
    <div id="content" class="widecolumn" role="main">
        <div class="leftmenu">
        <div class="topbox"><?php the_title(); ?> Blog</div>
        <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <ul>
            <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
        <?php endwhile; else: endif; ?>    
        </ul>
        <?php echo "SPECIAL TEST"; ?>
        <?php echo get_the_title(); ?>
    </div>
    
    
    <div class="post" id="post-<?php the_ID(); ?>">
        <h1 style="padding-top:10px"><?php the_title(); ?> Blog</h1>
        <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <?php endwhile; else: endif; ?>
        <div class="entry">        
            <?php query_posts('category_name='.get_the_title().'&post_status=publish,future');?>
            <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
            <div class="h1cat"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></div>
            <p class="catexcerpt"><?php excerpt('60')?>
            <?php endwhile; else: endif; ?>    
        </div>
    </div>
    
    PHP:
    Script is to create a webpage with all blog entries in a specific category. Also creates a left hand sidebar with a list of all posts found in that category.

    The Special test prints out the post title of the last post encountered in the first div

    In the second div I expected the whole process to be restarted but the <h1 style...> tag prints out the title of the last post in the list from the first div

    I would like it to start looking for posts all over again so I can print excerpts of the posts - any ideas?

    Thanks in advance.
     
    Last edited by a moderator: Jul 23, 2012
    amit.wadhwa, Jul 18, 2012 IP
  2. jeet25

    jeet25 Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    use <?php the_excerpt(); ?> tag to display excerpt
     
    jeet25, Jul 18, 2012 IP