diff --git a/functions.php b/functions.php index 6409cc7..7f19fae 100644 --- a/functions.php +++ b/functions.php @@ -20,4 +20,22 @@ function Hefz_Slider_PostType(){ 'supports' => array('title','editor','thumbnail','link') )); } -add_filter('init','Hefz_Slider_PostType'); \ No newline at end of file +add_filter('init','Hefz_Slider_PostType'); + +//پست تایپ برند ها +function Hefz_Brand_PostType(){ + register_post_type('Brands', array( + 'labels' => array( + 'name' => __('برند ها') , + 'singular_name' => __('برند') , + 'add_new' => __( 'افزودن برند'), + 'add_new_item' => __( 'افزودن برند'), + + ), + 'public' => true , + 'has_archive' => false , + 'supports' => array('title','editor','thumbnail','link'), + 'menu_icon' => 'dashicons-tickets-alt', + )); +} +add_filter('init','Hefz_Brand_PostType'); \ No newline at end of file diff --git a/home.php b/home.php index fa18f50..137d639 100644 --- a/home.php +++ b/home.php @@ -4,8 +4,8 @@
- //شروع بخش اسلایدر 'slider', 'posts_per_page' => 4 ); @@ -25,8 +25,9 @@ } // Restore original Post Data. wp_reset_postdata(); + //پایان بخش اسلایدر ?> - //پایان بخش اسلایدر +
@@ -318,14 +319,30 @@
-
-
-
-
-
-
-
-
+ 'Brands', + 'posts_per_page' => 9 + ); + $query = new WP_Query($args); + // The Query. + $the_query = new WP_Query( $args ); + + // The Loop. + if ( $the_query->have_posts() ) { + while ( $the_query->have_posts() ) { + $the_query->the_post();?> +
+ +