• Hi All,

    This is my first post as a member of the WordPress community. I am overall very impressed and happy with WordPress and will use it in nearly every site I design from now on.

    Anyways, the query:
    – I am using a widget which allows me to insert PHP into wordpress directly through posts / pages.
    – Using the widget, I have copied the original index.php code and pasted it into a page called Events.

    <?php query_posts("category_name=Events");?>
    		<?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    				<p><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></p>
    
    				<?php the_content('Read the rest of this entry &raquo;'); ?>
    
    				<p><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<ul>
    			<li><?php next_posts_link('&laquo; Older Entries') ?></li>
    			<li><?php previous_posts_link('Newer Entries &raquo;') ?></li>
    		</ul>
    
    	<?php else : ?>
    
    		<img class="title" src="http://www.tryty.co.uk/wp-content/themes/custom/images/title_not_found.gif" alt="Not Found" />
    		<p>Sorry, but you are looking for something that isn't here.</p>
    		<?php include (TEMPLATEPATH . "/searchform.php"); ?>
    
    	<?php endif; ?>

    The only real change is near the top where I have added “<?php query_posts(“category_name=Events”);?>” – so as to display only posts underneath the Events category.

    However, the results seem to not come out as expected:
    http://www.tryty.co.uk

    Any ideas?

    If what I am trying to achieve here is not the best method, please advise a better solution.

    All help is much appreciated.
    Thanks in advance,

    Kam

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Duplicate post titles being displayed’ is closed to new replies.