Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’m glad that fix seems to be working for now. In case anyone needs limitcats functionality to also affect the “Add Link” and “Edit Link” pages (WP 2.1 has semi-integrated links categories with posts categories), I’ve posted a modification of the fixed limitcats plugin at the same location as above, which is identical except for also affecting the “Add Link” and “Edit Link” pages like it affects the post editor.

    WP 2.1 changes the way category lists are displayed in the post editor (they are now unordered lists, which makes good sense to me), and that breaks the original limitcats plugin. I have a fix here that seems to work. Let me know if it helps you also.

    I am also developing a theme in which certain views use query_posts with an added showposts parameter (a la Kafkaesqui’s code above) in order to force a number of posts to display that is different from the number set by “Show at most” under admin->Options->Reading, and I also ran into the problem of posts_nav_link miscalculating the correct total number of results pages and therefore not displaying when it should. (Actually, because my showposts parameter is higher than my “Show at most” setting, posts_nav_link‘s misbehavior was that it showed an older-posts link when it shouldn’t have. But the problem is the same either way: posts_nav_link calculates paging on the basis of the default “Show at post” setting, even though it has effectively been overridden.) My current solution, which seems to work, is to set the global $posts_per_page = [showposts value] right after the query_posts call. Kafkaesqui’s code would be amended to:

    $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=3&showposts=2&paged=$page");
    $posts_per_page = 2

    So my question is: Is it an unsafe practice for a theme to be meddling with $posts_per_page like this, even though it is logical (as far as I can see) for the $posts_per_page value to change to correspond to the showposts query-variable?

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