Title: indorock's Replies | WordPress.org

---

# indorock

  [  ](https://wordpress.org/support/users/indorock/)

 *   [Profile](https://wordpress.org/support/users/indorock/)
 *   [Topics Started](https://wordpress.org/support/users/indorock/topics/)
 *   [Replies Created](https://wordpress.org/support/users/indorock/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/indorock/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/indorock/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/indorock/engagements/)
 *   [Favorites](https://wordpress.org/support/users/indorock/favorites/)

 Search replies:

## Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Paging inside "single" template using custom post type & custom query](https://wordpress.org/support/topic/paging-inside-single-template-using-custom-post-type-custom-query/)
 *  Thread Starter [indorock](https://wordpress.org/support/users/indorock/)
 * (@indorock)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/paging-inside-single-template-using-custom-post-type-custom-query/#post-2341262)
 * Never mind, waiting for an answer here took too long, so I decided to build a
   custom paging link function from scratch. It’s quick and dirty and might not 
   work for all situations, but it works for mine. So here it is.
 * [http://pastebin.com/Qic0g25i](http://pastebin.com/Qic0g25i)
 * A rundown of the function’s arguments:
 * **_$format_** and **_$link_**: Work in the same way as the $format and $link 
   arguments in the _previous\_post\_link()_ and _next\_post\_link()_ function.
 * **_$offset_**: can be a positive or negative integer, relative to the current
   post held by the global $post object. So, a value of 1 would give the next post
   and -1 would give previous one. But any other value will work. If the offset 
   exceeds the range of the set of posts, nothing is returned.
 * **_$post\_type_**: self-explanatory. Function is designed to only to query posts
   of one post type.
 * **_$order\_by_**: the name of the field inside your post by which to order your
   set of posts.
 * **_$custom\_query\_array_**: An array of arrays of key-value pairs that contains
   the parameters for the custom query. Same format as when composing a custom meta_query
   to be passed to the WP_Query object.
 * _**Example:**_
 *     ```
       $custom_query = array(
       	array(
       		'key' 		=> 'teammember_active',
       		'compare' 	=> '=',
       		'value' 	=> 'yes'
       	)
       );
   
       <div id="nav-above" class="navigation">
       	<div class="nav-previous"><?php echo get_offset_post_link('%link', '<span class="meta-nav">' . _x( '←', 'Previous post link', 'powerpuff' ) . '</span> %title', -1, 'tpb_teammember', 'title', $custom_query); ?></div>
       	<div class="nav-next"><?php echo get_offset_post_link('%link', '%title <span class="meta-nav">' . _x( '→', 'Next post link', 'powerpuff' ) . '</span>', 1, 'tpb_teammember', 'title', $custom_query); ?></div>
       </div><!-- #nav-above -->
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: ["Page not found" for sub-pages of specific slug](https://wordpress.org/support/topic/page-not-found-for-specific-slug-sub-pages/)
 *  [indorock](https://wordpress.org/support/users/indorock/)
 * (@indorock)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/page-not-found-for-specific-slug-sub-pages/#post-2088135)
 * Let me share my findings with this thread:
 * I found out the source of the problem was that my custom post type _teammember_‘
   s slug as defined in functions.php (i.e. “slug” => “**team**“) was conflicting
   with the slug of the subpage I had created (i.e. **/team/blabla/**). So, I suppose
   WP’s rewrite functionality cannot handle when it sees a url like _/team/blabla/_,
   it doesn’t know if “blabla” is the name of a subpage I manually created under
   the “team” page, or if it’s the name of an item of custom post type “team”. Apparently
   it gives the custom post type slug priority over the subpage’s slug, which is
   why it couldn’t deliver me the subpage _blabla_ and gave me a “Not Found” page
   instead.
 * My workaround was to change the custom post type’s slug to be _team/member_ (
   i.e. ‘slug’ => ‘team/member’) so now I can safely create any number of pages 
   with a slug format of _/team/xxxx/_ without having to worry about a conflict 
   with my CPT’s slug (just as long as I don’t give my subpage a slug of _/team/
   member/_, obviously :P)
 * HTH others!
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: ["Page not found" for sub-pages of specific slug](https://wordpress.org/support/topic/page-not-found-for-specific-slug-sub-pages/)
 *  [indorock](https://wordpress.org/support/users/indorock/)
 * (@indorock)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/page-not-found-for-specific-slug-sub-pages/#post-2088129)
 * Nicole I have the exact same behaviour as you are describing, weird. The parent
   page’s title is “The Team” but I want the path to just be “team” so I changed
   the slug thusly, but that’s when the 404s in all the sub pages started happening.
   Resetting the slug to “the-team” (default) fixes the issue. But I don’t want “
   the-team”!

Viewing 3 replies - 1 through 3 (of 3 total)