Lưu trữ tác giả: admin
Chép code sau vào HTML2 <a href=”#” onclick=”doGTranslate(‘vi|en’);return false;” title=”English” class=”glink nturl notranslate”><img src=”/wp-content/plugins/gtranslate/flags/24/en.png” height=”24″ width=”24″ alt=”English” /> <span>EN</span></a> <a href=”#” onclick=”doGTranslate(‘vi|vi’);return false;” title=”Vietnamese” class=”glink nturl notranslate”><img src=”/wp-content/plugins/gtranslate/flags/24/vi.png” height=”24″ width=”24″ alt=”Vietnamese” /> <span>VI</span></a> <style>#goog-gt-tt{display:none!important;}.goog-te-banner-frame{display:none!important;}.goog-te-menu-value:hover{text-decoration:none!important;}.goog-text-highlight{background-color:transparent!important;box-shadow:none!important;}body{top:0!important;}#google_translate_element2{display:none!important;}</style> <div id=”google_translate_element2″></div> <script>function googleTranslateElementInit2() {new google.translate.TranslateElement({pageLanguage: ‘vi’,autoDisplay: false}, ‘google_translate_element2’);}if(!window.gt_translate_script){window.gt_translate_script=document.createElement(‘script’);gt_translate_script.src=’https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit2′;document.body.appendChild(gt_translate_script);}</script> <script> function GTranslateGetCurrentLang() {var keyValue = document[‘cookie’].match(‘(^|;) ?googtrans=([^;]*)(;|$)’);return…
Mở file functions.php trong child theme của bạn (nếu chưa có child theme, bạn nên tạo child theme để tránh mất thay đổi khi update theme). Thêm đoạn code sau: // Thêm cột “Views” vào danh sách bài viết trong Dashboard add_filter(‘manage_posts_columns’, ‘posts_column_views’); add_action(‘manage_posts_custom_column’, ‘posts_custom_column_views’, 5, 2); function posts_column_views($defaults){ $defaults[‘post_views’] = __(‘Views’);…
Mở file functions.php trong child theme của bạn (nếu chưa có child theme, bạn nên tạo child theme để tránh mất thay đổi khi update theme). Thêm đoạn code sau: // Đăng ký metabox quảng cáo function webdy_ads_metabox() { add_meta_box( ‘webdy_ads_metabox’, ‘Quảng Cáo Dịch Vụ’, ‘webdy_render_ads_metabox’, [‘post’, ‘page’], ‘normal’, ‘default’ ); } add_action(‘add_meta_boxes’, ‘webdy_ads_metabox’);…
Mở file functions.php trong child theme của bạn (nếu chưa có child theme, bạn nên tạo child theme để tránh mất thay đổi khi update theme). Thêm đoạn code sau: /*thêm link sau bài viết*/ // Đăng ký metabox function custom_links_metabox() { add_meta_box( ‘custom_links_metabox’, …
Bạn có thể dán code script bằng các cách sau: Cách 1: Vào Giao diện → Tùy biến → Advanced (Nâng cao) cuộn xuống Custom JS (JavaScript tùy chỉnh) Cách 2: tạo file .js riêng và enqueue nó trong functions.php Cách 3: Dùng UX Blocks (theme Flatsome) hoặc các plugin có mục dán code js…
Bạn có thể dán code script bằng các cách sau: Cách 1: Vào Giao diện → Tùy biến → Advanced (Nâng cao) cuộn xuống Custom JS (JavaScript tùy chỉnh) Cách 2: tạo file .js riêng và enqueue nó trong functions.php Cách 3: Dùng UX Blocks (theme Flatsome) hoặc các plugin có mục dán code js…
Bạn có thể sử dụng add_filter() trong WordPress để thêm dữ liệu có cấu trúc JSON-LD giúp Google nhận diện Tên trang web (Site Name) theo hướng dẫn từ Google. Dưới đây là một function hoàn chỉnh để thêm dữ liệu JSON-LD vào <head> của trang: 🔹 Code: function add_json_ld_site_name() { // Lấy thông tin…
Cách 1: Vào Giao diện → Tùy biến → Advanced (Nâng cao) cuộn xuống Custom JS (JavaScript tùy chỉnh) Cách 2: tạo file .js riêng và enqueue nó trong functions.php Cách 3: Dùng UX Blocks (theme Flatsome) hoặc các plugin có mục dán code js như Code Snippets ,… Cách 4: Riêng theme Flatsome: wp-admin/admin.php?page=optionsframework…
