Skip to main content
Tweeted twitter.com/StackWordPress/status/733244176897347584
added 1139 characters in body
Source Link
AndrettiMilas
  • 1.1k
  • 6
  • 26
  • 55

I have a custom post type called portfolio. I need a previous/next link WITHOUT a plugin. Anybody have a solution?

Example post: http://themeforward.com/demo2/archives/portfolio/boat

<?php get_header(); ?>

<!-- Begin wrap -->
<div class="clear">
<div id="full_container">
<div id="content2">
<div id="content">

<!-- Grab posts -->
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

<!-- Post title -->
<h1>
    <?php the_title(); ?>
</h1>

<!-- The post -->
<?php the_content(); ?>

<!-- Tags -->
<h3 class="tags">
    <?php the_tags('Tags ',' / ','<br />'); ?>
</h3>

<!-- End wrap -->
</div>

<!-- Next/Previous Posts -->
<div class="mp_archive2">
<div id="more_posts">
    <div class="oe">
        <?php previous_post_link('%link', '« Previous post', TRUE); ?>
    </div>

    <div class="re">
        <?php next_post_link('%link', 'Next post »', TRUE); ?>
    </div>
</div>
</div>

<?php endwhile; else: ?>
<p>No matching entries found.</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>

I have a custom post type called portfolio. I need a previous/next link WITHOUT a plugin. Anybody have a solution?

I have a custom post type called portfolio. I need a previous/next link WITHOUT a plugin. Anybody have a solution?

Example post: http://themeforward.com/demo2/archives/portfolio/boat

<?php get_header(); ?>

<!-- Begin wrap -->
<div class="clear">
<div id="full_container">
<div id="content2">
<div id="content">

<!-- Grab posts -->
<?php if (have_posts()) : ?><?php while (have_posts()) : the_post(); ?>

<!-- Post title -->
<h1>
    <?php the_title(); ?>
</h1>

<!-- The post -->
<?php the_content(); ?>

<!-- Tags -->
<h3 class="tags">
    <?php the_tags('Tags ',' / ','<br />'); ?>
</h3>

<!-- End wrap -->
</div>

<!-- Next/Previous Posts -->
<div class="mp_archive2">
<div id="more_posts">
    <div class="oe">
        <?php previous_post_link('%link', '« Previous post', TRUE); ?>
    </div>

    <div class="re">
        <?php next_post_link('%link', 'Next post »', TRUE); ?>
    </div>
</div>
</div>

<?php endwhile; else: ?>
<p>No matching entries found.</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
Source Link
AndrettiMilas
  • 1.1k
  • 6
  • 26
  • 55

Custom Post Type Next/Previous Link?

I have a custom post type called portfolio. I need a previous/next link WITHOUT a plugin. Anybody have a solution?