Keyword

Counting Blog Posts for Pagination

  • Jarrod
  • Jarrod's Avatar Topic Author
  • Offline
  • New Member
More
13 years 7 months ago #94602 by Jarrod
Counting Blog Posts for Pagination was created by Jarrod
Ok this issue is a little comlpex but I will start by justifying why I am doing this. I have been using K2 as a designer for over a year and recently I am enrolled in some CS courses at a university. Wanting to apply the teachings immediately I am making little modifications to my personal site (call it hacking K2 or whatever, its helping me learn CS, so dont ask me "why?" there are reasons, but i dont care to go into them). I have come across an issue that is perplexing me. I cant find a solution.

 

I put a statement at the top of the user.php file. Its a sub template file (makes a user blog post listing page) in com_k2 > templates > user.php. I dont want the blog posts in the category "Portfolio" to be published. The statement reads:

 

 
<?php if($item->category->name != 'Portfolio') :?>
[template code and html for each post]
<?php endif;?>

 

 

As you can see if the category "Portfolio" comes up it will not be printed. But pagination is getting screwed up because it is still counting these blog posts. I am wondering if there is an easy way to subtract 1 from the counter every time so that pagination will be normal. If this needs clarification I can show you what is happening and copy my code.

 

Please Log in or Create an account to join the conversation.

More
13 years 7 months ago #94603 by william white
Replied by william white on topic Counting Blog Posts for Pagination
From forum search - hope its helpfull

as refered to inthis post you will be looking for pagination.php for the code to talk to

Styling for pagination css styling here

How to put pagination into template override

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum