CODE CODIFY.CLUB

Total Custom Post and Pages

// total number of pages ST —-

$type = “home-videos”;
$display_post =9;

$destinationtotal = array(‘post_type’ =>$type, ‘posts_per_page’ =>-1, );
$destinationtotals = new WP_Query( $destinationtotal );
$total_post = (int)$destinationtotals->found_posts;
$total_pages = ceil($total_post/$display_post);

OR

$count_posts = wp_count_posts($type);
$total_post = $count_posts->publish;
$total_pages = ceil($total_post/$display_post);

// total number of pages EN —-

V!ral

Developer, Technology aficionado, Beer Lover and founder of codify.club Network. Who shares a keen interest about website development, health issues, cancer awareness and other fun stuff.

Add comment

Follow us

Don't be shy, get in touch. We love meeting interesting people and making new friends.

Most popular

Most discussed