WordPress – get categories

$type = wp_get_post_terms(get_the_ID(),’custom_catergories’,[‘fields’=>’names’]); $terms = get_terms( array(‘taxonomy’ => ‘consultant_catergories’));

WordPress自建ajax function

Custom build an ajax in WordPress 當一般主題 WordPress Theme 或 plug-in 未能解決功能而要,為有自己動手自建功能。 首先相信大家必定對 PHP、ajax 及 WordPress theme 內 function.php 有基本認識。

如何為 woocommerce product variation 加入自定欄目 custom field

當 WordPress 一般文章 post 或頁面 page 的後台輸入不能滿足及方便日後更新,或令客戶難於管理。自定欄目 custom field 就是其中之一的理想工具,特別是自定主題 theme 的設計版面 template。 要加入自定欄目 custom field 正常情況可使用本身 WordPress custom field 功能,或透過插件 plug-in。根據經驗比例喜歡使用 Advanced Custom Fileds (ACF) 。但有時也可自行制定,如今次例子想在 woocommerce 產品的多選項目 variation 下加入。 修改 theme 內的 function.php