How to use next_posts_link/previous_posts_link for custom post types paginate?

This is the code that worked for me. I have a custom post type called “feature” defined like this: $args = array( ‘label’ => ‘feature’, ‘description’ => ‘Product feature pages’, ‘labels’ => array( ‘name’ => ‘Features’, ‘singular_name’ => ‘Feature’, ‘menu_name’ => ‘Feature’, ‘parent_item_colon’ => ‘Parent Feature:’, ‘all_items’ => ‘All Features’, ‘view_item’ => ‘View Feature’, ‘add_new_item’ … Read more

How to use a variable as a function name?

<?php $numcpost = of_get_option(‘how_many_custom_posts’); do { add_action( ‘init’, ‘register_cpt_mdframework_price’, $numcpost ); –$numcpost; } while ( $numcpost > 0 ); function register_cpt_mdframework_price( $numcpost ) { $singcpost = of_get_option(‘custom_posts_name_s_n’.$numcpost.”); $plurcpost = of_get_option(‘custom_posts_name_p_n’.$numcpost.”); $desccpost = of_get_option(‘custom_posts_name_d_n’.$numcpost.”); $imgcpost = of_get_option(‘custom_posts_name_i_n’.$numcpost.”); $labels = array(); // labels for $numcpost = 1 $labels[1] = array(/*typo was here*/ ‘name’ => _x( $plurcpost, ‘mdframework_custom_created_post’.$numcpost.” … Read more

Custom Post not working as expected

Ok, I solved it, maybe instead of asking I should drink 1 more coffe or sleep something more, anyway the solution is to move this part: $singcpost = of_get_option(‘custom_posts_name_s_n1’); $plurcpost = of_get_option(‘custom_posts_name_p_n1’); $desccpost = of_get_option(‘custom_posts_name_d_n1’); $imgcpost = of_get_option(‘custom_posts_name_i_n1’); After the opening function… Here is the corrected code: <?php /* IF 1 Start */ add_action( ‘init’, … Read more