Mark, first of all thanks for ur kind reply ...
I didnt mention it ; but I have tried category templates before ...
BTW, I am in degub mode at the moment, and it becomes clear for me to see everything in index.php for a while.
If I can make pagination work and do not produce 404 errors, I will make the code more efficient with category templates. But for a while category templates issue doesnt make any sense.
For example ; I have only one category with ID 3 and 40 posts in it. So, logically when I set a posts per page limit of 5 for wp_query variable, and use a conditional tag in index.php to show all posts from category 3, there has to be 8 pages ...
wp_query max_num_pages variable returns value of 8, which is theorically true for my case, so my custom pagination function returns page numbers from 1 to 8 as expected ...
So ; up to this point ... $posts_per_page, $paged and $max_num_pages variables acts as expected, and custom pagination function which also generates page listing with these query variables works as expected too ...
Here ... The problem comes out ...
I have 8 pages of posts grouped by 5, with page numbers from 1 to 8. Everything went OK until I navigate to page 5. Page 5 redirects me to 404.php. And also wp_title generates a 404 too. Instead of using wp_query variables which are all set to their expected values doesnt make any sense. WP still uses "Blog pages show at most" value taken from reading pane to generate 404s ...
So when I click over page 5, (which shouldnt exist there due to the limit in reading pane (40/10 = 4)) it generates a 404.
What if there is no 404 template ; EVERYTHING works fine except the wp_title errors which are not so SEO Friendly.
So this is the situation ...
Any ideas are welcome ...