Title: Link forward / back
Last modified: September 12, 2022

---

# Link forward / back

 *  Resolved [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * (@dirk1973)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/)
 * I can add how much post should appear on one side. But is it possible to go to
   the next page, if there are more posts?
    Can I do it with the pagination=”yes”?
   If Yes its not working. I`m I doing something wrong?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Flink-forward-back%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Rounak Kumar](https://wordpress.org/support/users/rounakkumar/)
 * (@rounakkumar)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004046)
 * Yes you can use pagination=”yes” attribute for pagination.
    Example: `[show_posts_pbs_rk
   layout="1" no_of_post="6"  pagination="yes"]`
 * in the above shortcode number of post is set to 6 and pagination is set to yes.
   So if number of post will greater than 6 then pagination will appear.
 *  Thread Starter [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * (@dirk1973)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004231)
 * Hi Rounak,
    that’s what I mean. its not working and I don’t know why.
 * That’s the shortcode:
 * `[show_posts_pbs_rk layout="6" hide_category="yes" category_id="55" read_more_lebel
   ="MEHR …" no_of_post="2" pagination="yes"]`
 * That’s the page:
 * [https://queer-hannover.de/beitraege](https://queer-hannover.de/beitraege)
 * There are 4 posts, so there should be the paging, right?
 *  Plugin Author [Rounak Kumar](https://wordpress.org/support/users/rounakkumar/)
 * (@rounakkumar)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004284)
 * Okay, pagination will not work if **category_id** attribute in shortcode.
    If
   you want to use pagination then you have to remove **category_id** attribute 
   from shortcode. Currently pagination will work with all attribute except category_id.
   Thank you.
 *  Thread Starter [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * (@dirk1973)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004357)
 * Ok that`s sad. Are planing to change it? Might it be possible?
 *  Plugin Author [Rounak Kumar](https://wordpress.org/support/users/rounakkumar/)
 * (@rounakkumar)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004441)
 * I have created a quick code for you.
    You can paste this code above return $content;
   in posts-by-shortcode-rk.php file.
 *     ```
       /* Show Pagination for category attribute */
       	if($pagination_attr == 'yes' && $category_id != 0){
   
       		$args = array(
       		  'cat' => $category_id,
       		  'post_type' => 'post'
       		);
   
       		$the_query = new WP_Query( $args );
       		$total_posts = $the_query->found_posts;
       		$total_page = ceil($total_posts/$post_per_page);
   
       		if($total_posts > $post_per_page){
       			$content .= '<div class="pbs_rk_pagination">';
       			$content .= '<ul>';
   
       			for($count = 1;$count<=$total_page;$count++){
       				if($_GET['offset'] == $count || (empty($_GET['offset']) && $count == 1)){
       					$content .='<li class="active"><a href="?offset='.$count.'">'.$count.'</a></li>';
       				}else{
       					$content .='<li class=""><a href="?offset='.$count.'">'.$count.'</a></li>';
       				}
       			}
   
       			$content .= '</ul>';
       			$content .= '</div>';
       		}
       	}
       ```
   
 * I hope it will help.
 *  Thread Starter [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * (@dirk1973)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16004714)
 * Thank you so much for your afford and helping!
 * Sadly its not working. I will get this Error message:
 * Parse error: syntax error, unexpected ‘&’ in /homepages/34/d389907052/htdocs/
   clickandbuilds/Queer/wp-content/plugins/posts-by-shortcode/posts-by-shortcode-
   rk.php on line 183
 *  Plugin Author [Rounak Kumar](https://wordpress.org/support/users/rounakkumar/)
 * (@rounakkumar)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16070428)
 * I have added new version of plugin and added functionality of pagination to category_id
   attribute.
    I have added more attribute to shortcode for more control. you can
   use them now.
 *  Thread Starter [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * (@dirk1973)
 * [3 years, 8 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16082656)
 * Thank you!

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

The topic ‘Link forward / back’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-by-shortcode_cfd1ab.svg)
 * [Posts By Shortcode](https://wordpress.org/plugins/posts-by-shortcode/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/posts-by-shortcode/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/posts-by-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-by-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-by-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-by-shortcode/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [dirk1973](https://wordpress.org/support/users/dirk1973/)
 * Last activity: [3 years, 8 months ago](https://wordpress.org/support/topic/link-forward-back/#post-16082656)
 * Status: resolved