WordPress.org

Ready to get started?Download WordPress

Forums

Ambrosite Next/Previous Post Link Plus
'ex_posts' => '11' (only wor (3 posts)

  1. idowning
    Member
    Posted 2 years ago #

    Hey Ambrosite,

    Thanks again for helping me with the 'in_same_tax' earlier. It works great in 3.2 as well now.

    Now I'm stumped on the current issue I'm having. I have another site where I'm cycling through rooms (custom post type posts) based on custom taxonomy. It does this great, but I don't want it to show one of the posts in that cycle, so I put in the 'ex_posts' => '11' (11 is the id of the custom post I don't want to show). This works with the function previous_post_link_plus, but for some reason is not in the next_post_link_plus.

    <li class="postLink wsPrev"><?php previous_post_link_plus( array(
    							 	'order_by'		=> 'menu_order',
    		 					'loop'			=> true,
    			 					'link'			=> 'Previous Room',
    			 					'before'		=> '',
    			 					'after'			=> '',
    			 					'format'		=> '%link',
    			 					'echo'			=> true,
    			 					'ex_posts' 		=> '11',
    			 					'in_same_tax'	=> true
    
    ) ); ?></li>
    <li class="postLink wsNext wsLast"><?php next_post_link_plus( array(
    						 					'order_by'		=> 'menu_order',
    						 					'loop'			=> true,
    						 					'link'			=> 'Next Room',
    						 					'before'		=> '',
    						 					'after'			=> '',
    						 					'format'		=> '%link',
    						 					'echo'			=> true,
    						 					'ex_posts' 		=> '11',
    						 					'in_same_tax'	=> true
    					 							) ); ?></li>

    Any insight as to what I may be doing wrong?

    Thanks

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

  2. ambrosite
    Member
    Plugin Author

    Posted 2 years ago #

    idowning,

    There is a bug in ex_posts that only shows up when loop is set to 'true'. That might be what is causing your problem. I have fixed the bug in version 2.3; the new version is not in the plugin directory yet, but if you want to give it a try you can download it here:

    http://www.ambrosite.com/download/ambrosite-post-link-plus.2.3.zip

    If you install the new version it will overwrite the hack I gave you before; however it is now possible to specify a custom taxonomy using in_same_tax, like this:

    'in_same_tax' => 'my_taxonomy'

  3. ambrosite
    Member
    Plugin Author

    Posted 2 years ago #

    Version 2.3 has been released to the plugin directory. The above download link is dead; please get the new version from the directory:

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic