Here are the different methods to make your fetch URL dynamic: Method 1: Auto-detect Current Domain (Recommended for most cases) javascriptconst apiUrl = `${window.location.protocol}//${window.location.hostname}${window.location.port ? ':' + window.location.port : ''}/wp-json/wp/v2/domain`...
阅读更多 »Recent Posts
在wp网站部署社交链接的模块
要执行先要加载fontawesome到网站,记得要同时下载fonts文件夹,这些是svg的样式。 How to Add More Social Networks Method 1: Using the Filter (Recommended) Add this to your theme's functions.php after the main code: // Add custom social networks function add_more_social_networks($networks...
阅读更多 »@wordpress/create-block 创建多个blocks框架教程
创建自定义的Block的归类,然后注册block的时候在block.json里面将category改成这个: /** * Register custom block category * * @param array $categories Array of block categories. * @param WP_Block_Editor_Context $editor_context The current block editor context. * @return array Modified array ...
阅读更多 »
WP开发教程 WordPress导师在线教程