Chia sẻ kinh nghiệm

Làm sao để lấy tiêu đề bài viết hiện tại đưa vào contact form

Khi muốn lấy tiêu đề bài viết hay bất kỳ cái gì của bài viết hiện tại để đưa vào contact form ta cài thêm plugin contact form dynamic text extension sau khi cài vô xong ta dùng 1 field type là dynamic text   CF7_get_post_var key=’post_title’   Muốn lấy giá trị từ form dùng phương thức post thì ta …

Tiếp tục đọc
Chia sẻ kinh nghiệm

Thêm class cho hình

Khi sử dụng wordpress bạn cần thêm 1 số class cho mọi hình mình tải lên trang wordpress sau đâu là đoạn code giúp bạn làm điều đó // thêm class cho cai hinh function wpc_add_image_responsive_class( $html ){ $classes = ‘img-responsive‘; // separated by spaces, e.g. ‘img image-link’   // check if there are already classes assigned to the anchor …

Tiếp tục đọc
Chia sẻ kinh nghiệm

Cách import font vào web

Đầu tiên ta phải tải các file .ttf hoặc .wof nói chung là các phải của font sau đó ta lưu trong thư mục fonts của theme cần import sau đó bỏ các đoạn css này vào file style.css @font-face { font-family: ‘helveticaneue’; src:url(../font/helveticaneue.ttf); font-weight: normal; font-style: normal; }   Sau đó khi gọi ra ta dùng cách như sau …

Tiếp tục đọc
Chia sẻ kinh nghiệm

Cách bỏ border trên mega menu plugin

Khi bạn sử dụng plugin mega menu bạn cần bỏ cái border của nó.Mình sẽ giới thiệu các bạn đoạn css làm việc này #mega_main_menu.direction-horizontal > .menu_holder > .menu_inner > ul > li > .item_link:before, #mega_main_menu.direction-horizontal > .menu_holder > .menu_inner > .nav_logo:before, #mega_main_menu.direction-horizontal > .menu_holder > .menu_inner > ul > li.nav_search_box:before{background-image:none !important} Các bạn bỏ vào file style.css của theme …

Tiếp tục đọc
Chia sẻ kinh nghiệm

Hiển thị lượt xem không dùng plugin

Bước 1 Bỏ hàm này vào file functions.php   function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘0’); return “0 View”; } return $count.’ Views’; } function setPostViews($postID) { $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘0’); }else{ $count++; update_post_meta($postID, $count_key, $count); } } …

Tiếp tục đọc
Chia sẻ kinh nghiệm

Lỗi Headers and client library….

Khi bạn chuyển sang hosting mới mà server sài công nghệ quá cap chúng ta sẽ bị lỗi web do phiên bản php quá mới.Sau đây là cách khắc phục Khi host cập nhật phiên bản php mới 5.6 thì website của tôi đưa ra cảnh báo mysqli_real_connect(): Headers and client library minor version mismatch. Headers:100020 Library:100114 in /home/suck/public_html/wp-includes/wp-db.php on …

Tiếp tục đọc