From b2ce252c6123551b264093166bc40ea72079b08a Mon Sep 17 00:00:00 2001 From: heydar Date: Fri, 30 May 2025 14:24:01 +0330 Subject: [PATCH] =?UTF-8?q?=D8=B3=D8=A7=D8=AE=D8=AA=20=D9=BE=D8=B3=D8=AA?= =?UTF-8?q?=20=D8=AA=D8=A7=DB=8C=D9=BE=20=D8=A8=D8=B1=D8=A7=DB=8C=20=D8=A8?= =?UTF-8?q?=D8=AE=D8=B4=20=D8=A8=D8=B1=D9=86=D8=AF=20=D9=87=D8=A7=20=D9=88?= =?UTF-8?q?=20=D8=AD=D9=84=20=D8=AC=D8=A7=DB=8C=20=DA=AF=D8=B2=D8=A7=D8=B1?= =?UTF-8?q?=DB=8C=20=DA=A9=D8=A7=D9=85=D8=AA=20=D8=B3=D9=85=D8=AA=20=D8=A8?= =?UTF-8?q?=DA=A9=D9=86=D8=AF=20=D8=AF=D8=B1=20=D8=A7=D8=B3=D9=84=D8=A7?= =?UTF-8?q?=DB=8C=D8=AF=D8=B1=20=D8=AF=D8=A7=DB=8C=D9=86=D8=A7=D9=85=DA=A9?= =?UTF-8?q?=20=DA=A9=D8=B1=D8=AF=D9=86=20=D8=A8=D8=AE=D8=B4=20=D8=A8=D8=B1?= =?UTF-8?q?=D9=86=D8=AF=20=D9=87=D8=A7=20=D8=A8=D8=A7=20=D8=A7=D8=B3=D8=AA?= =?UTF-8?q?=D9=81=D8=A7=D8=AF=20=D8=A7=D8=B2=20=D9=BE=D8=B3=D8=AA=20=D8=AA?= =?UTF-8?q?=D8=A7=DB=8C=D9=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.php | 20 +++++++++++++++++++- home.php | 37 +++++++++++++++++++++++++++---------- 2 files changed, 46 insertions(+), 11 deletions(-) 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();?> +
+ +