• Resolved aarron81

    (@aarron81)


    Hi All

    I am just working on my first wordpress website and got into a little trouble.

    I am using custom post types for media releases and a custom archive page to call the media release title and issuer and link them both to the post.

    The custom post type is working perfectly and so is the archive page with one small problem, the first title the archive page pulls is not linked, however each subsequent title and issuer is. Is there something I have missed from the following code?

    Cheers

    <?php
     $query = new WP_Query( array( 'post_type' => array( 'media_releases' ) ) );
    
    while ( $query->have_posts() ) : $query->the_post();
    	echo '
    	<table><tr><td><a href="';
    	the_permalink();
    	echo '">';
    	the_title();
    	echo '</a></td>'; ?>
    
    	<td>
    <a href="<?php the_permalink(); ?>">
    <?php $terms_as_text = get_the_term_list( $post->ID, 'issuer', '', ', ', '' ) ; ?>
    	<?php echo strip_tags($terms_as_text); ?></a></td></tr></table>
    
    <?php endwhile; ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • might be a css problem with some layer covering the link;

    please post a live link to the problem site

    Thread Starter aarron81

    (@aarron81)

    Thanks for the respose alchymyth

    The site is on my local machine, so cannot post a link.

    I have been playing around and comparing the archive to the default archive file and was missing out the following:

    <?php the_post(); ?>
    		<div id="post-<?php the_ID() ?>" class="post">
    			<h1 class="post-title"><?php the_title() ?></h1>

    By adding that in, all works correctly.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help with code’ is closed to new replies.