• Resolved dirk1973

    (@dirk1973)


    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 to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Rounak Kumar

    (@rounakkumar)

    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

    (@dirk1973)

    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

    There are 4 posts, so there should be the paging, right?

    Plugin Author Rounak Kumar

    (@rounakkumar)

    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

    (@dirk1973)

    Ok that`s sad. Are planing to change it? Might it be possible?

    Plugin Author Rounak Kumar

    (@rounakkumar)

    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

    (@dirk1973)

    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

    (@rounakkumar)

    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

    (@dirk1973)

    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Link forward / back’ is closed to new replies.