seattleturtle
Forum Replies Created
-
Forum: Plugins
In reply to: Limit Categories plugin not working in 2.1?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.
Forum: Plugins
In reply to: Limit Categories plugin not working in 2.1?Forum: Fixing WordPress
In reply to: Posts_nav_link now won’t show upI am also developing a theme in which certain views use
query_postswith an addedshowpostsparameter (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 ofposts_nav_linkmiscalculating the correct total number of results pages and therefore not displaying when it should. (Actually, because myshowpostsparameter 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_linkcalculates 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 thequery_postscall. 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 = 2So my question is: Is it an unsafe practice for a theme to be meddling with
$posts_per_pagelike this, even though it is logical (as far as I can see) for the$posts_per_pagevalue to change to correspond to theshowpostsquery-variable?