Categories
Wordpress

Hooks on WordPress Edit Post Admin Page

There are hooks that allow you to display any content in a particular place on the admin page of adding or editing any type of post.

Thanks to hooks below, you can make the publication more convenient. All depends on your programming skills and imagination. For example:

  • Place video or text right before the visual editor with tips on writing content.
  • Show images already attached to the post as a slider.
  • Show photos from Google by keyword so you can choose one of them for a thumbnail.
  • Display a calculator for counting calories, if you publish a recipe post.
  • And much more that require your certain task and allow programming skills.

Hooks map

A visual representation of where and what kind of hook is used.

Categories
Tối ưu Server Wordpress

Config WP Super cache and Nginx

Standard WordPress-Nginx configuration with WP Super cache support:

As you are getting into Nginx, I hope you don’t need my help with configuring WP Super Cache plugin.

Still, make sure you are using “Use mod_rewrite to serve cache files. (Recommended)” option under “Advanced” tab.

Following configuration supports:

  1. Static Page Caching using Disk
  2. Direct browser cache for static content like images, js, css, etc

    https:https://thinhcoi.com/wp-content/uploadshttps://thinhcoi.com/wp-content/uploadsgist.github.comhttps://thinhcoi.com/wp-content/uploads21c4b021871d7607d8b1.git

    Note:

    To simplify configuration, I haven’t added Mobile user agent checks. We are in the iPhone era where finally phones are getting smart. So there is no need to create separate mobile site, when you can cater to today’s iPhonehttps://thinhcoi.com/wp-content/uploadsAndroid devices using responsive designs.

    Don’t Forget:

    Always test your Nginx configuration and then reload it. All changes to Nginx config must be followed with these commands:

    nginx -t && service nginx reload
    Important Note:

    WP Super Cache caching will conflict with plugins that uses query vars. WooCommerce is an example known plugin known to work with above configuration. Reason is following line:

    try_files https://thinhcoi.com/wp-content/uploadswp-contenthttps://thinhcoi.com/wp-content/uploadscachehttps://thinhcoi.com/wp-content/uploadssupercachehttps://thinhcoi.com/wp-content/uploads$http_hosthttps://thinhcoi.com/wp-content/uploads$cache_urihttps://thinhcoi.com/wp-content/uploadsindex.html $uri $urihttps://thinhcoi.com/wp-content/uploads https://thinhcoi.com/wp-content/uploadsindex.php ;
    It doesn’t passes $args to https://thinhcoi.com/wp-content/uploadsindex.php. If you set last try_files argument to https://thinhcoi.com/wp-content/uploadsindex.php?$args as with other WordPress-Nginx configuration, WP Super Cache, itself will break!

Categories
Wordpress

[Plugin] Rút gọn link cho wordpress với Go.gl

Code rút gọn link dành cho blog wordpress dùng dịch vụ Go.gl của Google.

Paste code bên dưới vào file functions.php hoặc viết thành 1 plugin.

Updated: https:https://thinhcoi.com/wp-content/uploadshttps://thinhcoi.com/wp-content/uploadswordpress.orghttps://thinhcoi.com/wp-content/uploadspluginshttps://thinhcoi.com/wp-content/uploadsgooglhttps://thinhcoi.com/wp-content/uploads (đã có plugin trên wordpress.org)

https:https://thinhcoi.com/wp-content/uploadshttps://thinhcoi.com/wp-content/uploadsgist.github.comhttps://thinhcoi.com/wp-content/uploads595349c4b5af5880310f.git

Categories
Wordpress

[WordPress] Cách xóa tất cả phản hồi của 1 bài viết

Xóa tất cả phản hồi của 1 bài viết (wordpress)
* Chỉ áp dụng cho những người đọc mà hiểu

https:https://thinhcoi.com/wp-content/uploadshttps://thinhcoi.com/wp-content/uploadsgist.github.comhttps://thinhcoi.com/wp-content/uploads054f39f5ba721bd882ad.git

Thay “xxx” bằng ID của bài viết của bạn