• I am trying to make my “work” template work like my other links on my nav bar. Not too sure where I went wrong with my code but it isn’t showing the hr tag and The title. Thanks for the help!

    <?php
    /*
    
    	Template Name: Work Page
    
    */
    
    get_header(); ?>
    
    <p> This is the work.php file </p>
    
    <?php 
    
    $args = array( 'post_type'=>'work' );
    
    $the_query = new WP_Query( $args );
    
    ?>
    
    <?php if ( $the_query->have_posts() ) : while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
    
     	<h3><a href="<?php the_permalink(); ?>" <?php $the_query->the_title(); ?></h3>
     	<?php the_content(); ?>
     	<hr>
    
    <?php endwhile; else: ?>
    
    <p> customize later </p>
    
    <?php endif; ?>
    
    <?php get_footer(); ?>
Viewing 1 replies (of 1 total)
  • I think your ‘h3’ line should be this:

    <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
Viewing 1 replies (of 1 total)

The topic ‘custom template problems’ is closed to new replies.