cat_ID; //$paged = ( get_query_var( 'paged' ) ) ? absint( get_query_var( 'paged' ) ) : 1; echo "

".$categories[0]->cat_name."

"; if(check_auth() ){ echo category_description($category_id); //FOR PAGINATION------------ $count = 5; $get_string = explode( '?', $_SERVER['REQUEST_URI'] ); parse_str($get_string[1], $get_array); $page = 1; foreach($get_array as $param => $value){ if( $param == 'page' ) $page = $value; } if( isset($_GET["page"]) ){ $page = $_GET["page"]; }else if( get_query_var( 'paged' ) ){ $page = absint( get_query_var( 'paged' ) ); } $offset = $count * ($page - 1); //END------------------------ global $wpdb; $sql_total = "SELECT DISTINCT count(*) FROM `wp_posts` p " . "INNER JOIN `wp_term_relationships` cat_r " . "ON p.ID = cat_r.object_id WHERE term_taxonomy_id = {$category_id} " . "AND post_status = 'publish'"; $sql = "SELECT ({$sql_total}) as total ,p.* FROM `wp_posts` p " . "INNER JOIN `wp_term_relationships` cat_r " . "ON p.ID = cat_r.object_id WHERE term_taxonomy_id = {$category_id} " . "AND post_status = 'publish' ORDER BY post_date DESC LIMIT {$offset}, {$count}"; $results = $wpdb->get_results( $sql, OBJECT ); $total = $results[0]->total; //$total = $result'total']; $pagination = getPaginationLinks($page, $total, $count); foreach( $results as $post ) : setup_postdata($post); echo "
"; the_date('F j, Y', '
', '
'); $pdf_attachment_url = get_field('pdf_attachment'); $file_arr = explode('.', basename($pdf_attachment_url)) ; $ext = $file_arr[1]; if($pdf_attachment_url){ echo "

".get_the_title()."

"; echo the_excerpt(); echo "Read More..."; } //echo '

'.get_the_title().'

'; //$link = get_permalink(); //echo "
...Read More >>
"; //echo ""; //echo the_title(); //echo ""; //echo the_excerpt(); //echo "Read More..."; echo "
"; endforeach; //echo "
".$pagination; /* foreach( $myposts as $post ) : setup_postdata($post); echo "
"; the_date('F j, Y', '
', '
'); $pdf_attachment_url = get_field('pdf_attachment'); $file_arr = explode('.', basename($pdf_attachment_url)) ; $ext = $file_arr[1]; if($pdf_attachment_url){ echo "

".get_the_title()."

"; } //echo ""; //echo the_title(); //echo ""; //echo the_excerpt(); //echo "Read More..."; echo "
"; endforeach; */ }else{ echo show_login_form_adwanced(); } ?>