Template_Wordpress_Shop/functions.php

68 lines
3.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// این تابع برای برای منوی هدر میباشد
function hefz_header_menu(){
register_nav_menu('header-menu',__('هدر بالایی'));
}
add_action('init', 'hefz_header_menu');
//افزودن قابلیت های قالب
add_theme_support('post-thumbnails');
//پست تایپ اسلایدر
function Hefz_Slider_PostType(){
register_post_type('slider', array(
'labels' => array(
'name' => __('اسلایدرها') ,
'singular_name' => __('اسلایدر') ,
'add_new' => __( 'افزودن اسلایدر'),
'add_new_item' => __( 'افزودن اسلایدر'),
),
'public' => true ,
'has_archive' => false ,
'supports' => array('title','editor','thumbnail','link')
));
}
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');
function Hefz_Register_Widget(){
register_sidebar( array(
'name' => __('فوتر حفظ 1'),
'id' => 'footer-1',
'description' => __( 'در این بخش شما میتونید ابزارک های فوتر ستون اول رو اضافه کنید'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => "</div>\n"
) );
register_sidebar( array(
'name' => __('فوتر حفظ 2'),
'id' => 'footer-2',
'description' => __( 'در این بخش شما میتونید ابزارک های فوتر ستون دوم رو اضافه کنید'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => "</div>\n"
) );
register_sidebar( array(
'name' => __('فوتر حفظ 3'),
'id' => 'footer-3',
'description' => __( 'در این بخش شما میتونید ابزارک های فوتر ستون سوم رو اضافه کنید'),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => "</div>\n",
) );
}
add_action('widgets_init', 'Hefz_Register_Widget');