Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1094037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:54:59+00:00 2026-05-16T23:54:59+00:00

http://lakers.sonikastudios.com/gallery/sample-gallery-post-1/ That post has several pages using the quicktag of WordPress. This post is

  • 0

http://lakers.sonikastudios.com/gallery/sample-gallery-post-1/

That post has several pages using the quicktag of WordPress. This post is also is a custom post_type.. using the following code in the functions.php in the theme template.

add_action( 'init', 'create_post_type' );
    function create_post_type() {
        register_post_type( 'gallery',
            array(
                'labels' => array(
                'name' => __( 'Galleries' ),
                'singular_name' => __( 'Gallery' )
            ),
            'public' => true,
            'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'custom-fields', 'comments')
            )
        );

With this code, I managed to get a custom post type appearing in the admin section just fine. I added a new article there, with the page flippers..

So using the wp_link_pages() function, I got the page flipping functions working. But it only works on regular posts under the categories, but not for the posts that are defined as the ‘gallery’ post_type. For example, this page http://lakers.sonikastudios.com/editorials/catching-the-buss-to-the-hall-of-fame/3/ works just fine with the pagination within the post.

I’m not using any plugins that affect the post display method or navigation, and I did not mess with the .htaccess file – whatever WordPress wrote is what I got there.

Any help would be great.. the site’s almost ready and we hit this bottleneck and it’s killing me!

I’m using the latest version of WordPress, and I started development with the Whiteboard theme (the new one made for WP3). ]

UPDATED:
gallery.php (assigned via the Page module to display the post_type “gallery” – I confirmed that this is the file that loads when I load a gallery post_type post)

<?php
/*
Template Name: Gallery
*/
?>

<?php get_header();

$exclude = array();

?>
<div class="grid_11" id="mainbar">



    <?php if ( have_posts() ) while ( have_posts() ) : the_post();

    $exclude[]=get_the_ID();
    ?>
            <div id="post-<?php the_ID(); ?>" <?php post_class('grid_11 alpha omega'); ?>>
                <h2><a href="<? the_permalink(); ?>" title="<? the_title();?>"><? the_title();?></a></h2>
                <div class="social_media_balloons">
                <?
                if (function_exists('fbshare_manual')) echo fbshare_manual();
                ?>
                <?
                if (function_exists('tweetmeme')) echo tweetmeme();
                ?>
                </div>
                    <?
                    $author_gravatar = get_gravatar(get_the_author_meta('user_email'));
                    ?>
                    <img src="<? echo $author_gravatar;?>" class="alignleft" />
            <?
            echo posted_by_and_category();

            ?>

                    <div class="grid_11 alpha omega">

                        <?php the_content(); ?>
                        <div id="single_article_selectors">

                        <?php wp_link_pages('before=<div class="single_article_selector">&after=</div>'); ?>
                        <?php wp_link_pages('before=<div class="single_article_selector">&after=</div>&next_or_number=next'); ?>

                        </div>

                        <div class="grid_11 alpha omega" id="social_media_links">
                        <div class="grid_5 alpha">
                            <p><a href="http://www.twitter.com/LakersNation" target="_blank"><img src="/images/twittericon.jpg" alt="Twitter" width="32" height="32" class="alignleft">Follow Lakers Nation </a></p>
                            <p><a href="http://feeds.feedburner.com/LakersNation" target="_blank"><img src="/images/rssicon.jpg" alt="Twitter" width="32" height="32" class="alignleft">Subscribe to Lakers Nation</a></p>
                        </div>
                        <div class="grid_5 omega">
                            <p><a href="http://www.facebook.com/lakersnation" target="_blank"><img src="/images/fbicon.jpg" alt="Twitter" width="32" class="alignleft">Become a Fan on Facebook</a></p>
                            <p><a href="http://itunes.apple.com/us/app/app-of-l-nation/id349346678?mt=8" target="_blank"><img src="/images/iphoneicon.png" alt="Twitter" width="32" height="32" class="alignleft">Download our Free iPhone App</a></p>
                        </div>
                    </div>


                        <div class="shadow_divider"></div>
                    </div><!--#post-content-->

                    <!-- If a user fills out their bio info, it's included here -->
                    <div id="post-author" class="grid_11 alpha omega">
                        <h3>Written by <?php the_author_posts_link() ?></h3>
                        <div id="author-gravatar">
                            <!-- This avatar is the user's gravatar (http://gravatar.com) based on their administrative email address -->
                            <?php echo get_avatar( $curauth->user_email, $default = '<path_to_url>' ); ?>
                        </div><!--#author-gravatar -->
                        <div id="authorDescription">
                            <?php the_author_meta('description') ?> 
                            <div id="author-link">
                                <p>View all posts by: <?php the_author_posts_link() ?></p>

                            </div><!--#author-link-->
                        </div><!--#author-description -->
                    </div><!--#post-author-->

                </div><!-- #post-## -->

                <div class="grid_11 alpha omega next_prev_links">
                    <div class="grid_3 alpha">
                        <p>
                            <?php previous_post_link('%link', '&laquo; Previous post') ?>
                        </p>
                    </div><!--.older-->
                    <div class="grid_3 omega" style="float:right; text-align:right;">
                        <p>
                            <?php next_post_link('%link', 'Next Post &raquo;') ?>
                        </p>
                    </div><!--.older-->
                </div><!--.newer-older-->

                <?php comments_template( '', true ); ?>

    <?php endwhile; ?><!--end loop-->
</div><!--#content-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

single.php (regular post display template by default..)

<?php get_header();

$dirpath = str_replace(get_bloginfo('url'), '',get_bloginfo('template_directory'));
?>
<div class="grid_11" id="mainbar">



    <?php if ( have_posts() ) while ( have_posts() ) : the_post();

    $exclude[]=get_the_ID();
    ?>

            <div id="post-<?php the_ID(); ?>" <?php post_class('grid_11 alpha omega'); ?>>

            <?
            echo posted_by_single();
            ?>
            <div class="grid_11 alpha omega">
                <div id="single_post_title">
                <h1><a href="<? the_permalink(); ?>" title="<? the_title();?>"><? the_title();?></a></h1>

                </div>
                <div class="social_media_balloons">
                <?
                if (function_exists('fbshare_manual')) echo fbshare_manual();
                ?>
                <?
                if (function_exists('tweetmeme')) echo tweetmeme();
                ?>
                </div>

                <div class="grid_11 alpha omega">

                    <?php the_content(); ?>
                    <div id="single_article_selectors">

                    <?php wp_link_pages('before=<div class="single_article_selector">&after=</div>'); ?>
                    <?php wp_link_pages('before=<div class="single_article_selector">&after=</div>&next_or_number=next'); ?>

                    </div>

                    <div class="grid_11 alpha omega" id="social_media_links">
                        <div class="grid_5 alpha">
                            <p><a href="http://www.twitter.com/LakersNation" target="_blank"><img src="/images/twittericon.jpg" alt="Twitter" width="32" height="32" class="alignleft">Follow Lakers Nation </a></p>
                            <p><a href="http://feeds.feedburner.com/LakersNation" target="_blank"><img src="/images/rssicon.jpg" alt="Twitter" width="32" height="32" class="alignleft">Subscribe to Lakers Nation</a></p>
                        </div>
                        <div class="grid_5 omega">
                            <p><a href="http://www.facebook.com/lakersnation" target="_blank"><img src="/images/fbicon.jpg" alt="Twitter" width="32" class="alignleft">Become a Fan on Facebook</a></p>
                            <p><a href="http://itunes.apple.com/us/app/app-of-l-nation/id349346678?mt=8" target="_blank"><img src="/images/iphoneicon.png" alt="Twitter" width="32" height="32" class="alignleft">Download our Free iPhone App</a></p>
                        </div>
                    </div>

                    <div class="shadow_divider"></div>
                </div><!--#post-content-->


            </div><!-- #post-## -->



                <div class="grid_11 alpha omega next_prev_links">
                    <div class="grid_3 alpha">
                        <p>
                            <?php previous_post_link('%link', '&laquo; Previous post') ?>
                        </p>
                    </div><!--.older-->
                    <div class="grid_3 omega" style="float:right; text-align:right;">
                        <p>
                            <?php next_post_link('%link', 'Next Post &raquo;') ?>
                        </p>
                    </div><!--.older-->
                </div><!--.newer-older-->
            <div class="grid_11 alpha omega" id="comments_container">
            <?php comments_template( '', true ); ?>
            </div>
        </div>
    <?php endwhile; ?><!--end loop-->
</div><!--#mainbar-->
<?php get_sidebar(); ?>
<?php get_footer(); ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:54:59+00:00Added an answer on May 16, 2026 at 11:54 pm

    The issue your having is pagination with custom post type. There is a good thread on WordPress.org with some examples and solutions used to get it working.

    A similar question has been answered already on StackOverflow


    Edit:

    I was not able to reproduce the error using the code you provided.

    See: Custom Post Type Pagination Test

    To create the test I took the following steps:

    1. Uploaded and installed the Whiteboard theme from the themes home page

    2. Added the sample code provided to functions.php to create the post type

    3. Copied the code provided "Gallery Template" and renamed it single-gallery.php

    (Template hierarchy looks for single-PostType.php then single.php when displaying a single post type page)

    1. Created a new gallery by clicking gallery add new

    2. Inserted 4 images using add media

    3. Inserted <!--nextpage--> between each image

    4. Saved post and updated permalinks

    alt text

    Test Environment

    • WordPress version: 3.0.1
    • PHP version: 5.2.13
    • Theme: whiteboard
    • Permalink: /%year%/%monthnum%/%postname%/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://developer.yahoo.com/javascript/howto-proxy.html Are there disadvantages to this technique? The advantage is obvious, that you can
http://support.microsoft.com/kb/953102 We spent about 50 hours during Christmas holiday to identify this problem, causing
http://www.codeplex.com/IIRF/Thread/List.aspx My webhost installed IIRF for me and I am convinced that they did
According to this http://steve-yegge.blogspot.com/2007/06/rich-programmer-food.html article, I defnitely should. Quote Gentle, yet insistent executive summary:
http://thedailywtf.com/Articles/The-Hot-Room.aspx You see how at the bottom there're links to the next and previous
http://localhost:50034/Admin/Delete/723 Always needs this parameter to perform the action, however, if you go to
http://leepoint.net/notes-java/data/expressions/22compareobjects.html It turns out that defining equals() isn't trivial; in fact it's moderately hard
http://weblogs.java.net/blog/kgh/archive/2004/10/multithreaded_t.html argues that multithreaded GUI frameworks are a failed dream. What about non-GUI frameworks?
http://en.wikipedia.org/wiki/ICalendar I'm working to implement an export feature for events. The link above lists
http://en.wikipedia.org/wiki/Diamond_problem I know what it means, but what steps can I take to avoid

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.