This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Register Custom Post Types | |
add_action('init', 'register_custom_posts_init'); | |
function register_custom_posts_init() { | |
// Register Products | |
$products_labels = array( | |
'name' => 'Products', | |
'singular_name' => 'Product', | |
'menu_name' => 'Products' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$args = array( | |
'post_type' => 'products', | |
'post_status' => 'publish', | |
'posts_per_page' => '10' | |
); | |
$products_loop = new WP_Query( $args ); | |
if ( $products_loop->have_posts() ) : | |
while ( $products_loop->have_posts() ) : $products_loop->the_post(); | |
// Set variables |