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.

    http://brewspook.com/project/secondary-portfolio-item/

    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?

    Thanks!
    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…

    Thread Starter Stevie Caldarola

    (@steviecald)

    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:

    Thread Starter Stevie Caldarola

    (@steviecald)

    Header code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html lang='en'>
    <head>
        <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" />
        <![endif]-->
        <body class="home blog">
        <div id="nav-bar-tile">
    	<div id="nav-bar-content">
    	<a href="http://www.brewspook.com"> <img src="http://brewspook.com/wp-content/uploads/2012/02/logo.png"> </a>
    	<div id="nav-bar-links" class="nav-bar-links"><a href="http://www.brewspook.com/approach/" title="Approach">Approach</a> |	<a href="http://www.brewspook.com/portfolio" title="Portfolio">Portfolio</a> | <a href="http://www.brewspook.com/contact" title="Contact">Contact</a> </div>
    	</div><!-- nav-bar-content -->
    	</div><!-- nav-bar-tile -->
    	</head>
    	<div id="wrapper">
            <div id="content">

    Thread Starter Stevie Caldarola

    (@steviecald)

    Could it be something from the Portfolio gallery base page?

    <div class="post">
       <?php
                    $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(); ?>  
    
                            <?php
                            $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 = '';
                            endif;
                            ?>  
    
                            <?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>  
    
                            </li>  
    
                        <?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.