Khi xây dựng một website, việc chọn cấu hình hosting phù hợp là một trong những quyết định quan trọng để đảm bảo trang web hoạt động mượt mà, tải nhanh và ổn định. Bài viết này sẽ giúp bạn hiểu các yếu tố cần thiết và đề xuất cấu hình hosting tối ưu cho…
Lưu trữ tác giả: admin
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:
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 |
// Ẩn UX Builder và chặn truy cập trực tiếp nếu không phải Admin function webdy_hide_ux_builder_for_non_admins() { if (!current_user_can('administrator')) { // Ẩn menu UX Builder trong Admin Menu add_action('admin_menu', function() { remove_menu_page('ux-builder'); }, 999); // Chặn truy cập trực tiếp vào UX Builder qua URL add_action('admin_init', function() { $current_url = $_SERVER['REQUEST_URI']; if (strpos($current_url, 'app=uxbuilder') !== false) { wp_die('Bạn không có quyền truy cập UX Builder.'); } }); // Ẩn nút "Edit with UX Builder" trong trang chỉnh sửa bài/post add_action('add_meta_boxes', function() { remove_meta_box('ux_builder_edit_button', 'page', 'side'); remove_meta_box('ux_builder_edit_button', 'post', 'side'); // Nếu có Custom Post Type thì thêm dòng này: // remove_meta_box('ux_builder_edit_button', 'ten_custom_post_type', 'side'); }, 999); } } add_action('init', 'webdy_hide_ux_builder_for_non_admins'); |
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:
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 |
add_filter( 'woocommerce_get_availability', 'webdy_custom_out_of_stock', 1, 2 ); function webdy_custom_out_of_stock( $availability, $_product ) { if ( ! $_product->is_in_stock() ) { // Hotline button HTML $hotline = '<a class="webdy-hotline-out-of-stock" href="tel:0902299161" target="_blank">'; $hotline .= '<i class="fa fa-phone" aria-hidden="true"></i> Gọi ngay: 090.22.99.161</a>'; // Thêm CSS nội tuyến 1 lần duy nhất (nếu chưa chèn) if ( ! wp_script_is( 'webdy-hotline-style', 'done' ) ) { add_action( 'wp_footer', function() { echo '<style id="webdy-hotline-style"> .webdy-hotline-out-of-stock { padding: 10px 25px; font-size: 1rem; font-weight: bold; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; border-radius: 10px; background-color: #fff; color: #000; position: relative; z-index: 1; overflow: hidden; } .webdy-hotline-out-of-stock::before { content: ""; position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px; background: linear-gradient(45deg, red, orange, yellow, green, cyan, blue, violet, red); background-size: 400%; z-index: -1; animation: rainbow 5s linear infinite; border-radius: 12px; } .webdy-hotline-out-of-stock:hover { color: #fff; background-color: #000; } @keyframes rainbow { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } } </style>'; }); wp_script_add_data( 'webdy-hotline-style', 'group', 1 ); // đánh dấu đã chèn } $availability['availability'] = $hotline; } return $availability; } |
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:
1 2 3 4 |
function add_fontawesome_icons() { wp_enqueue_style( 'font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css' ); } add_action( 'wp_enqueue_scripts', 'add_fontawesome_icons' ); |
1. Đăng nhập vào SSH bằng PuTTy hoặc phần mềm khác, login tài khoản root. 2. Dùng lệnh sau: Nếu đổi pass cho root: passwd Nếu đổi pass cho user bất kỳ, ví dụ ở đây là admin: passwd admin
Câu hỏi rất thực tế và quan trọng! Việc “nhét từ khóa” (keyword placement) vào bài viết không phải là cứ lặp lại từ khóa thật nhiều là được — Google thông minh hơn thế nhiều rồi. Giờ đây, bạn phải SEO một cách tự nhiên, có chiến lược và kỹ thuật, để Google hiểu…
Để SEO lên top 1, mình không chỉ cần tối ưu website của mình mà còn phải “soi” đối thủ top 1 thật kỹ lưỡng, như một kế hoạch chiến đấu thực sự. Dưới đây là các yếu tố bạn cần phân tích kỹ từ đối thủ, và cách bạn có thể cải thiện website…
1. Kiểm tra xem WordPress core đã được cập nhật chưa: Vào Dashboard > Updates > nhấn “Update Now”. Việc cập nhật lõi WordPress là một trong những khía cạnh quan trọng nhất của bảo mật trang web. Nếu phát hiện ra lỗ hổng trong WordPress và phát hành phiên bản mới để giải quyết…
Chép code sau vào HTML2
1 2 3 4 5 6 7 8 9 10 11 |
<!-- GTranslate: https://gtranslate.io/ --> <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 keyValue ? keyValue[2].split('/')[2] : null;} function GTranslateFireEvent(element,event){try{if(document.createEventObject){var evt=document.createEventObject();element.fireEvent('on'+event,evt)}else{var evt=document.createEvent('HTMLEvents');evt.initEvent(event,true,true);element.dispatchEvent(evt)}}catch(e){}} function doGTranslate(lang_pair){if(lang_pair.value)lang_pair=lang_pair.value;if(lang_pair=='')return;var lang=lang_pair.split('|')[1];if(GTranslateGetCurrentLang() == null && lang == lang_pair.split('|')[0])return;if(typeof ga=='function'){ga('send', 'event', 'GTranslate', lang, location.hostname+location.pathname+location.search);}var teCombo;var sel=document.getElementsByTagName('select');for(var i=0;i<sel.length;i++)if(sel[i].className.indexOf('goog-te-combo')!=-1){teCombo=sel[i];break;}if(document.getElementById('google_translate_element2')==null||document.getElementById('google_translate_element2').innerHTML.length==0||teCombo.length==0||teCombo.innerHTML.length==0){setTimeout(function(){doGTranslate(lang_pair)},500)}else{teCombo.value=lang;GTranslateFireEvent(teCombo,'change');GTranslateFireEvent(teCombo,'change')}} </script> |