Viewing 1 replies (of 1 total)
  • Hi, wartes

    Follow below steps to add category Column.

    Replace Line No 42 with below code

    $html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Category').'</th><th>'.__('Type').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';

    Replace line no 68,69,70 with below code

    $html .= '<tr class="found-posts"><td class="found-radio"><input type="checkbox" id="found-'.$post->ID.'" name="found_post_id[]" value="' . esc_attr($post->ID) . '"></td>';
    		$html .= '<td><label for="found-'.$post->ID.'">'.esc_html( $post->post_title ).'</label></td>';
    		$getcategories = get_the_category( $post->ID );
    		if(!empty($getcategories)) {
    			$html .= '<td>';
    				foreach ($getcategories as $getcategory) {
    				$html .= $getcategory->name.'<br />';
    				}
    			$html .= '</td>';
    		}
    
    		$html .= '<td>'.esc_html( $posttype ).'</td><td>'.esc_html( $time ).'</td><td>'.esc_html( $stat ).'</td></tr>'."\n\n";
Viewing 1 replies (of 1 total)

The topic ‘how to add category ?’ is closed to new replies.