Tag: custom post type

Pagination for custom post in wordpress

Here is how to implement Pagination for custom posts in wordpress. Add this to functions.php function pagination_bar() { global $wp_query; $total_pages = $wp_query->max_num_pages; if ($total_pages > 1){ $current_page = max(1, get_query_var('paged')); echo paginate_links(array( 'base' => get_pagenum_link(1) . '%_%', 'format' =>...

How to create custom post type in wordpress ?

Add this code to your website theme functions.php file.. <?php function nst_custom_post() { register_post_type( 'Movie', array( 'labels' => array( 'name' => __( 'Movie' ), 'singular_name' => __( 'Movie' ) ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' =>...
Click to Chat