| 
					 1 2 3 4 5 6 7 8 9  | 
						$bongdanet_theme = wp_get_theme(); define('BONGDANET_VERSION',time()); define('BONGDANET_DIR',get_stylesheet_directory()."/"); define('BONGDANET_CLASSES_DIR',get_stylesheet_directory()."/includes/classes/"); define('BONGDANET_URL',get_template_directory_uri()."/"); define('BONGDANET_ASSETS_URL',BONGDANET_URL."assets/"); define('BONGDANET_JS_URL',BONGDANET_ASSETS_URL."js/"); define('BONGDANET_CSS_URL',BONGDANET_ASSETS_URL."css/"); define('BONGDANET_IMAGES_URL',BONGDANET_ASSETS_URL."images/");  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46  | 
						function daunhon_setup() { 	load_theme_textdomain( 'daunhon' ); 	add_theme_support( 'automatic-feed-links' ); 	add_theme_support( 'title-tag' ); 	add_theme_support( 'custom-logo', array( 		'height'      => 107, 		'width'       => 151, 		'flex-height' => true, 	) ); 	add_theme_support( 'post-thumbnails' ); 	set_post_thumbnail_size( 1200, 9999 ); 	register_nav_menus( array( 		'main-menus'  => esc_attr__( 'Menus Chính', 'daunhon' ) 	) ); 	add_theme_support( 'html5', array( 		'search-form', 		'comment-form', 		'comment-list', 		'gallery', 		'caption', 	) ); 	add_theme_support( 'post-formats', array( 		'aside', 		'image', 		'video', 		'quote', 		'link', 		'gallery', 		'status', 		'audio', 		'chat', 	) ); 	add_theme_support( 'customize-selective-refresh-widgets' ); 	add_image_size( 'daunhon_product_cat', 500, 314, TRUE ); 	add_image_size( 'daunhon_product_cat2', 300, 300, TRUE ); 	add_image_size( 'daunhon_news', 230, 130, TRUE ); 	add_theme_support( 'woocommerce' ); 	 //add_theme_support( 'wc-product-gallery-zoom' ); 	//add_theme_support( 'wc-product-gallery-lightbox' ); 	//add_theme_support( 'wc-product-gallery-slider' ); register_nav_menus( array( 		'vertical'  => esc_attr__( 'Vertical Menu', 'vtx' ), 		'menus-home-top-bar'  => esc_attr__( 'Menus Top Bar', 'vtx' ), 	) ); } add_action( 'after_setup_theme', 'daunhon_setup' );  | 
					
| 
					 1 2 3 4 5  | 
						<a href="<?php echo home_url(); ?>">                 <?php $custom_logo_id = get_theme_mod( 'custom_logo' ); 				$logo = wp_get_attachment_image_src( $custom_logo_id , 'full' ); ?>                     <img src="<?php echo $logo[0]; ?>"/>                 </a>  | 
					
| 
					 1 2 3 4 5  | 
						function daunhon_styles() { 	wp_register_style( 'daunhon-bootstrap', get_stylesheet_directory_uri().'/assets/css/bootstrap.css', array(), wp_get_theme()->get( 'Version' ), false ); 	wp_enqueue_style('daunhon-bootstrap'); } add_action( 'wp_enqueue_scripts', 'daunhon_styles' );  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14  | 
						function daunhon_scripts(){ 	wp_register_script( 'daunhon-jquery-ui', get_stylesheet_directory_uri().'/assets/js/jquery-ui.js', array( 'jquery'), wp_get_theme()->get( 'Version' ), false ); 	wp_register_script( 'daunhon-scripts', get_stylesheet_directory_uri().'/assets/js/daunhon-scripts.js', array( 'jquery'), wp_get_theme()->get( 'Version' ), false ); 	wp_enqueue_script( 'daunhon-jquery-ui'); 	wp_enqueue_script( 'daunhon-scripts'); 	wp_localize_script( 'daunhon-scripts', 		'daunhon_vars', 		apply_filters( 'daunhon_vars', array( 			'ajax_url' => admin_url( 'admin-ajax.php', 'relative' ), 		) ) 	); } add_action( 'wp_enqueue_scripts', 'daunhon_scripts' );  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57  | 
						add_action( 'init', 'daunhon_register_post_type' ); function daunhon_register_post_type() {  	register_post_type( 'daunhon_slide', 		array( 			'labels' => array( 				'name'          => __( 'Slide', 'daunhon' ), 				'singular_name' => __( 'Slide', 'daunhon' ), 				'add_new'            => _x( 'Thêm mới', 'daunhon_slide', 'daunhon' ), 			), 			'has_archive'  => false, 			'hierarchical' => true, 			'menu_icon'    => 'dashicons-format-gallery', 			'public'       => true, 			'show_in_menu' => true, 			'rewrite'      => array( 'slug' => 'slide', 'with_front' => true ), 			'supports' => array( 'title','thumbnail'), 			'menu_position'         => 5 		) 	); 	register_post_type( 'daunhontinh', 		array( 			'labels' => array( 				'name'          => __( 'Tỉnh', 'daunhon' ), 				'singular_name' => __( 'Tỉnh', 'daunhon' ), 				'add_new'            => _x( 'Thêm mới', 'daunhontinh', 'daunhon' ), 			), 			'has_archive'  => false, 			'hierarchical' => true, 			'menu_icon'    => 'dashicons-admin-site-alt3', 			'public'       => true, 			'show_in_menu' => true, 			'rewrite'      => array( 'slug' => 'vung-mien', 'with_front' => true ), 			'supports' => array( 'title','thumbnail','editor'), 			'menu_position'         => 7 		) 	); 	register_taxonomy( 'daunhontinh_cat', 'daunhontinh', array(     'labels' => array(       'name'              => __( 'Vùng miền', 'daunhon' ),       'singular_name'     => __( 'Vùng miền', 'daunhon' ),       'search_items'      => __( 'Tìm kiếm Vùng miền', 'daunhon' ),       'all_items'         => __( 'Vùng miền', 'daunhon' ),       'parent_item'       => __( 'Cha', 'daunhon' ),       'parent_item_colon' => __( 'Cha:', 'daunhon' ),       'edit_item'         => __( 'Chỉnh sửa', 'daunhon' ),       'update_item'       => __( 'Cập nhật', 'daunhon' ),       'add_new_item'      => __( 'Thêm mới', 'daunhon' ),       'new_item_name'     => __( 'Thêm mới', 'daunhon' ),       'menu_name'         => __( 'Vùng miền', 'daunhon' ),     ),     'rewrite'           => array('slug' => 'vung-mien', 'hierarchical' => true ),     'hierarchical'      => true,     'show_admin_column' => true,     'query_var'         => true   )); }  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13  | 
						if( function_exists('acf_add_options_page') ) { 	acf_add_options_page(array( 		'parent_slug' => 'edit.php?post_type=product', 		'icon_url' => 'dashicons-star-filled', 		'page_title' 	=> 'Slogan và mô tả', 		'menu_title'	=> 'Slogan và mô tả', 		'menu_slug' 	=> 'home-product-slogan', 		'capability'	=> 'edit_posts', 		'redirect'		=> false 	)); }  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  | 
						function custom_excerpt($string="",$limitword="",$kytu=""){ 	$string=strip_tags($string); 	$string= preg_replace('/\n/',' ', trim($string)); 	$array = explode(' ', $string); 	$string=""; 	if($limitword > count($array)): 		$limitword=count($array); 	else: 		$limitword=$limitword; 	endif;	 	for($i=0; $i<$limitword;$i++): 		$string .=$array[$i]." "; 	endfor; 	$string = strip_shortcodes($string); 	return $string.$kytu; }  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61  | 
						if ( ! function_exists( 'clean_custom_menu' ) ) : 	function clean_custom_menu( $theme_location ) { 		if ( ($theme_location) && ($locations = get_nav_menu_locations()) && isset($locations[$theme_location]) ) { 			$menu = get_term( $locations[$theme_location], 'nav_menu' ); 			$menu_items = wp_get_nav_menu_items($menu->term_id); 			//var_dump($menu_items); 			$menu_list  = ''; 			$menu_list .= '<ul class="nav navbar-nav">' ."\n"; 			$count = 0; 			$submenu = false; 			foreach( $menu_items as $menu_item ) { 				$link = $menu_item->url; 				$title = $menu_item->title; 				if ( !$menu_item->menu_item_parent ) { 					$parent_id = $menu_item->ID; 					if(!empty($menu_items[ $count +1 ]) && ($menu_items[ $count +1 ]->menu_item_parent == $parent_id)){  						$menu_list .= '<li class="dropdown mega-dropdown">' ."\n"; 						$menu_list .= '<a href="'.$link.'" class="dropdown-toggle" data-toggle="dropdown">'.$title.'</a>' ."\n"; 					} 					else{ 						$menu_list .= '<li>' ."\n"; 						$menu_list .= '<a href="'.$link.'" >'.$title.'</a>' ."\n"; 					} 				} 				if ( $parent_id == $menu_item->menu_item_parent ) { 					if ( !$submenu ) { 						$submenu = true; 						$menu_list .= '<ul class="dropdown-menu mega-dropdown-menu">' ."\n"; 					} 				   $menu_list .= '<li>' ."\n"; 					$menu_list .= '<a href="'.$link.'" >'.$title.'</a>' ."\n"; 					$menu_list .= '</li>' ."\n"; 					if ( $menu_items[ $count +1 ]->menu_item_parent != $parent_id && $submenu ){ 						$menu_list .= '</ul>' ."\n"; 						$submenu = false; 					} 				} 				$count++; 			} 			$menu_list .= '</ul>' ."\n"; 		} else { 			$menu_list = '<!-- no menu defined in location "'.$theme_location.'" -->'; 		} 		echo $menu_list; 	} endif;  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13  | 
						function daunhon_widgets_init() { 	register_sidebar( array( 		'name'          => __( 'Footer 1', 'daunhon' ), 		'id'            => 'footer-1', 		'description'   => __( 'Footer 1', 'daunhon' ), 		'before_widget' => '<div id="%1$s" class="widget %2$s">', 		'after_widget'  => '</div>', 		'before_title'  => '<h3>', 		'after_title'   => '</h3>', 	) ); } add_action( 'widgets_init', 'daunhon_widgets_init' );  | 
					
| 
					 1 2 3 4 5  | 
						   <?php     if ( is_active_sidebar( 'footer-1' ) ) :      dynamic_sidebar('footer-1' );	     endif;      ?>  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  | 
						// 1. customize ACF path add_filter('acf/settings/path', 'my_acf_settings_path'); function my_acf_settings_path( $path ) {     $path = get_stylesheet_directory() . '/includes/custom-fields/';     return $path; } // 2. customize ACF dir add_filter('acf/settings/dir', 'my_acf_settings_dir'); function my_acf_settings_dir( $dir ) {     $dir = get_stylesheet_directory_uri() . '/includes/custom-fields/';     return $dir; } // 3. Hide ACF field group menu item add_filter('acf/settings/show_admin', '__return_true'); include_once( get_stylesheet_directory(). '/includes/custom-fields/acf.php' );  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17  | 
						<?php $defaults = array( 'theme_location'  => 'main-menus', 'container'       => '', 'container_id'    => '', 'menu_class'      => 'nav clearfix mrtungcustom', 'menu_id'         => '', 'echo'            => true, 'fallback_cb'     => 'wp_page_menu', 'before'          => '', 'after'           => '', 'link_before'     => '', 'link_after'      => '', 'items_wrap'      => '<ul class="%2$s">%3$s</ul>', ); wp_nav_menu( $defaults );  ?>  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11  | 
						add_action( 'pre_get_posts', 'modify_posts_per_page' ); function modify_posts_per_page($query) { 	if(is_woocommerce() && !is_admin()) : 		 $query->set( 'posts_per_page',12); 		 $query->set( 'orderby','date'); 		 $query->set( 'order','DESC'); 	endif;	 	//echo '<pre>'; print_r( $query); echo '</pre>';  	//return 	$query; }  | 
					
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14  | 
						<?php $big = 999999999; // need an unlikely integer $paginate= paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), //'total' => $the_query->max_num_pages 'type' => 'list' ) ); //var_dump($paginate); ?> <div class="pagination-wrap"> 	<?php echo $paginate; ?> </div>  | 
					
Chỉ cần gọi: flatsome_posts_pagination();
Bình luận
Mọi sự sao chép xin ghi rõ nguồn là fcwordpress.net
Chuyên trang về wordpress: hướng dẫn thiết kế theme, plugin, thủ thuật wordpress
Chili Comment. Giấy phép không hợp lệ. Kích hoạt tại đây