Support » Themes and Templates » Adding Navigation to Project Single.php

  • Hi there,

    I’m trying (desperately) to finish a new theme and am in need of adding navigation links (Prev | Next) to single.php project posts for a portfolio section of the website.

    I’ve added in the following code:

    <span class="alignRight"><id ="navigation"><?php previous_post_link('%link', 'Prev', TRUE); ?>
    | <?php next_post_link('%link', 'Next', TRUE); ?></span></div>

    As you can see, only the “|” is showing up. The links will not show for some reason.

    Any ideas?

    Stevie Caldarola

Viewing 5 replies - 1 through 5 (of 5 total)
  • Just off the top of my head it looks like you have an error in your tags right here:

    class=”alignRight”><id =”navigation”>

    Those >< might be throwing it off…

    Thanks- I took them out, but the links still aren’t showing.

    huh..thats weird. are you doing anything in the header that might be throwing the loop off? saw this:

    Header code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
    <html lang='en'>
        <title><?php bloginfo('name'); ?> <?php wp_title(); ?></title>
        <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/reset.css" type="text/css">
        <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css">
        <!--[if IE]>
        <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/ie.css" type="text/css" />
        <body class="home blog">
        <div id="nav-bar-tile">
    	<div id="nav-bar-content">
    	<a href=""> <img src=""> </a>
    	<div id="nav-bar-links" class="nav-bar-links"><a href="" title="Approach">Approach</a> |	<a href="" title="Portfolio">Portfolio</a> | <a href="" title="Contact">Contact</a> </div>
    	</div><!-- nav-bar-content -->
    	</div><!-- nav-bar-tile -->
    	<div id="wrapper">
            <div id="content">

    Could it be something from the Portfolio gallery base page?

    <div class="post">
                    $loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1));
                    $count =0;
                <div id="portfolio-wrapper">
                    <ul id="portfolio-list">  
                    <?php if ( $loop ) :   
                        while ( $loop->have_posts() ) : $loop->the_post(); ?>  
                            $terms = get_the_terms( $post->ID, 'tagportfolio' );  
                            if ( $terms && ! is_wp_error( $terms ) ) :
                                $links = array();  
                                foreach ( $terms as $term )
                                    $links[] = $term->name;
                                $links = str_replace(' ', '-', $links);
                                $tax = join( " ", $links );
                            else :
                                $tax = '';
                            <?php $infos = get_post_custom_values('_url'); ?>  
                            <li class="portfolio-item <?php echo strtolower($tax); ?> all">
                                <div class="thumb"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail( array(400, 160) ); ?></a></div>
                                <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>  
                        <?php endwhile; else: ?>
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding Navigation to Project Single.php’ is closed to new replies.