Ngày mới An Nhiên » WordPress » WordPress tips, tricks

WordPress tips, tricks

XAMPP Mysqli_real_connect(): (hy000/1045): access denied for user ‘root’@’localhost’ (using password: no)

Trong quá trình sử dụng XAMPP nếu vô tình điều chỉnh thông tin passwords root tại localhost sẽ hay gặp lỗi không thể kết nối với mysql local nữa. Mysqli_real_connect(): (hy000/1045): access denied for user ‘root’@’localhost’ (using password: no) Cách giải quyết là khởi chạy XAMPP mục config mở my.ini thêm dòng sau vào dưới …

XAMPP Mysqli_real_connect(): (hy000/1045): access denied for user ‘root’@’localhost’ (using password: no) Read More »

Tùy chỉnh thư mục lưu trữ định dạng file cụ thể

Trong 1 số trường hợp cụ thể quá trình phát triển plugin/ theme nhất định chúng ta cần lưu trữ dữ liệu upload lên theo nhu cầu nào đó.   Ở trường hợp trong bài mình đang xử lý plugin scale design cho hệ thống bán áo thun mình đang phát triển tại PolyXGO. Dữ …

Tùy chỉnh thư mục lưu trữ định dạng file cụ thể Read More »

How to fix and hidden Warning/ Notices: error in WordPress

Sometime your site make any mistake by code or value: variable is empty, null, themes error, plugins error… WordPress may be display them in your screen. Some times, it is terrible. How to fix? You need to check your code and fix them. Follow message your get, see path file make issue. Open the file with …

How to fix and hidden Warning/ Notices: error in WordPress Read More »

Bảo toàn nội dung soạn thảo trong custom metabox có sử dụng trình soạn thảo HTML

Bảo toàn nội dung soạn thảo trong custom metabox có sử dụng trình soạn thảo HTML để hiển thị ngoài giao diện. //$metabox_content= str_replace(array(“\\r\\n”, “\\r”), “<br/>”, $metabox_content); $metabox_content=wpautop($metabox_content); echo $metabox_content;  

How to fix “Uncaught TypeError: $template.get is not a function” in Visual Composer

Sometime before when my site updated WordPress version 4.5. I get a issue with “Uncaught TypeError: $template.get is not a function” in Visual Composer plugin. I’m debugging and search with error message and found an answer help me fixed this bug by updating the html2element function in file /wp-content/plugins/js_composer/assets/js/backend/composer-view.js from: /** * Convert html into correct element * …

How to fix “Uncaught TypeError: $template.get is not a function” in Visual Composer Read More »

How to fix Warning: Cannot modify header information – headers already sent by

This error you can read more at: http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F but if you don’t resolved, please consult my problem header(“Location:”.admin_url(‘admin.php?page=polygon-template-style-html-manager-add-category&polygon_excute_msg=delete-success’)); exit(); If put function exit() here you maybe get an error “How to fix Warning: Cannot modify header information – headers already sent by…“. So, remove it and check again maybe it’s ok.

How to get current user role in WordPress ?

Hi everybody, this post i share about “How to get current user role in WordPress ?”. If you developing plugins or themes in WordPress you need get user role and current_user_can is function help you do that. <?php if(current_user_can(‘administrator’) ) { //Do action here if role valid is administrator; }?> If you need to check …

How to get current user role in WordPress ? Read More »