• hello guys i guess evything is in the title i made an effort and searchedthe codex and stuff and end up with this but its not workin at all (moslt cus i dont kno really how wp works behind the seen)

    [code]
    function open_old_cmmt_status(){
    global $wpdb ;
    $post = get_post( the_ID() );
    if( !comments_open() ) {
    if( in_category( 1 ,$post) ){

    $wpdb->query(" UPDATE $wpdb->posts SET comment_status=open ") ;
    }
    }
    }
    add_filter( "comments_open", "open_old_cmmt_status" ) ;
    [/code]

    well seen the result of this code it turn out the hole site unvailable so i just feels like posting so you can guys correct me and guid me and
    thanks guys in advance

Viewing 1 replies (of 1 total)
  • Thread Starter kosaidpo

    (@kosaidpo)

    sorry guys for the double reply but i dont see any edit button

    hello guys i guess evything is in the title i made an effort and searchedthe codex and stuff and end up with this but its not workin at all (moslt cus i dont kno really how wp works behind the seen)

    function open_old_cmmt_status(){
    global $wpdb ;
    $post = get_post( the_ID() );
     if( !comments_open() ) {
        if( in_category( 1 ,$post) ){
         $wpdb->query(" UPDATE $wpdb->posts SET comment_status=open ") ;
        }
      }
    }
    add_filter( "comments_open", "open_old_cmmt_status" ) ;

    well seen the result of this code it turn out the hole site unvailable so i just feels like posting so you can guys correct me and guid me and
    thanks guys in advance

Viewing 1 replies (of 1 total)
  • The topic ‘make comments open permently for certain categories’ is closed to new replies.