How to show previous 1,2,3 … next links for my custom Gallery page?
-
I’m using WP3.0 with the purchased theme from http://organicthemes.com/demo/structure/portfolio/
Following the tutorial found at http://www.vooshthemes.com/blog/wordpress-tip/create-a-professional-portfolio-using-wordpress-3-0-custom-post-types/
I’ve managed to create a custom gallery page (it can be seen on http://iopixels.com/gallery/ipcc-gamesHowever, I’ve stumble upon a problem where I failed to display the next, previous links below my gallery page. I’ve read a lot of similar problems within this forum but found no luck so far.
Below is the code I entered into my function.php:
// Add Gallery post support
add_action(‘init’, ‘create_portfolio’);
function create_portfolio() {
$portfolio_args = array(
‘label’ => __(‘Portfolio’),
‘singular_label’ => __(‘Portfolio’),
‘public’ => true,
‘show_ui’ => true,
‘capability_type’ => ‘post’,
‘hierarchical’ => false,
‘rewrite’ => true,
‘supports’ => array(‘title’, ‘editor’, ‘thumbnail’, ‘custom-fields’)
);
register_post_type(‘portfolio’,$portfolio_args);
}The code of my portfolio.php as follow:
<?php
/*
Template Name: Portfolio
*/
?>
<?php get_header(); ?><div id=”content_portfolio”>
<?php
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$loop = new WP_Query( array(
‘post_type’ => ‘portfolio’,
‘posts_per_page’ => 9,
‘paged’=>$paged,
) ); ?><?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
<?php
$custom = get_post_custom($post->ID);
$screenshot_url = $custom[“screenshot_url”][0];
$website_url = $custom[“website_url”][0];
?><div id=”portfolio-title”>
<h1>” rel=”bookmark”><?php the_title(); ?></h1>
“><?php the_post_thumbnail(); ?><div id=”portfolio-content”>
<?php the_content(); ?>
</div></div>
<?php endwhile; ?>
<?php next_posts_link(‘« Previous posts’);echo ‘ ‘;previous_posts_link(‘Newer posts »’);?>
<div id=”prevLink”><p><?php previous_posts_link(); ?></p></div>
<div id=”nextLink”><p><?php next_posts_link(); ?></p></div></div>
<?php get_footer(); ?>
- The topic ‘How to show previous 1,2,3 … next links for my custom Gallery page?’ is closed to new replies.