adria
Forum Replies Created
-
Forum: Plugins
In reply to: Automatically Add Posts to A Category Conditionallythis function will automatically add all posts to category 9547, unless it is also in category bundle, or if the post is by author 29 or 30.
Forum: Plugins
In reply to: Automatically Add Posts to A Category Conditionallyok I figured it out. here is what I wanted to do, and it now works:
function add_category_automatically1($post_ID) { global $wpdb; $postsWeWants = $wpdb->get_results("SELECT ID, post_author FROM $wpdb->posts where ID = $post_ID"); foreach ($postsWeWants as $postsWeWant) { if(($postsWeWant->post_author != 30) && ($postsWeWant->post_author != 29) && !in_category('bundle')){ $cat = array(9547); wp_set_object_terms($post_ID, $cat, 'category', true); } } } add_action('publish_post', 'add_category_automatically1');Forum: Fixing WordPress
In reply to: exclude recent posts in a certain categorythanks, this got me what I needed. I just made two queries:
numberposts=-1&cat=9129&offset=4&orderby=post_date&showposts=4and
numberposts=-1&cat=-9129&orderby=post_date&showposts=6The first one gets that category I wanted, except the 4 most recent.
The second one gets the rest of the categories, excluding the category that I got above. Thanks for your help!Forum: Fixing WordPress
In reply to: Comments not showing and same comment on every postok, I’ll have to try this weekend when there is less traffic. I’ll reply if it worked or not. Thanks
Forum: Fixing WordPress
In reply to: Posts Not Visible on Home PageI just figured out my posts show up if I switch the theme from K2 (which it was) to the Default Kubrick theme. Maybe this helps figure out the problem?