在这个插件中,“语义(semantic)”指的是超越关键词字面匹配的意义理解。它主要用于“语义搜索”和“语义推荐”,也就是插件在搜索和推荐功能中会使用“内容的含义”来进行更智能的匹配,而不仅仅是对关键词的简单比对。 具体理解方式如下: ✅ 传统搜索(非语义) WordPress 默认搜索是基于关键词的。例如: 用...
阅读更多 »WP主题开发的安全性加固
Below is a checklist of hardening, cleanup, and performance-tweaks you can apply in your theme’s functions.php (or better yet, a small “theme-utilities” plugin). Feel free to cherry-pick what fits your project. 1. Secure the Theme 1.1 Hide WordPress Version Expose as little as possi...
阅读更多 »古登堡禁止block添加flex 布局 disable the is_layout_flex or is_layout_flow
// This line is preferably be added to your theme's functions.php file // with other add_theme_support() function calls.add_theme_support( 'disable-layout-styles' );
阅读更多 »wp编辑器关闭smat quote功能实现 引用号正常
wp自带编辑器有smart quote功能, 要关闭wptexturize。 WordPress 使用 wptexturize()函数 转换 ' 到 ’, ‘, 或取决于上下文的其他实体. 比方说会将let's 转换成 let' s 符号后面有空格符号形式也会转变, 所以要在钩子中去除掉这个函数 remove_filter('the_content', 'wptexturize'); remove_filter('the_title', 'w...
阅读更多 »如何给自定义表导入另外一个数据库的表的部分字段
比方说其他类型网站的数据库的表里有很多没用的字段,你在wordpress里的表单的字段去除了很多没用的字段,但是部分字段都还是重叠的状态,所以要确保被导入的表的字段符合要导入的表的字段,不然无法导入; 确保两个数据库相邻,去mysql后台运行sql命令: -- Make sure you're in the WordPress database USE you...
阅读更多 »SQL替换
I understand - you want to go the opposite direction and replace relative URLs with absolute ones. Here's the SQL command to do that: sqlCopyUPDATE wp_posts SET post_content = REPLACE( post_content, 'wp-content/uploads/', 'http://mydomain.com/wp-content/uploads/' ) WHERE post_c...
阅读更多 »VSCODE 扩展
Here are some of the most useful extensions for VS Code for web development, categorized based on your needs: PHP Extensions: PHP Intelephense Provides powerful auto-completion, IntelliSense, and code navigation for PHP. PHP Debug Debugging PHP code with Xdebug directly in VS Code....
阅读更多 »Canva slider
https://www.canva.com/design/DAGc1iNJKzk/KSvQWmQYoibx6IWoxDInEg/view?utm_content=DAGc1iNJKzk&utm_campaign=designshare&utm_medium=link2&utm_source=uniquelinks&utlId=haa3e9ef37f
阅读更多 »wp给菜单添加字段并控制二级菜单的输出方式wp nav menu class 教程 mega menu 教程
菜单也是wp_post的对象,首先给菜单添加字段: 添加字段: add_action('wp_nav_menu_item_custom_fields', 'add_mega_menu_type_field', 10, 4); function add_mega_menu_type_field($item_id, $item, $depth, $args) { $mega_menu_type = get_post_meta($item_id, '_mega_menu_type', true); ?> ...
阅读更多 »PHP面向对象OOP基础知识
PHP 的面向对象编程(OOP)是编程中的一种范式,允许开发者通过定义类和对象来创建更模块化和可扩展的代码。以下是 PHP OOP 的一些基础知识: 1. 类与对象 类:类是一个模板,定义了对象的属性和方法。它可以看作是对象的蓝图。 对象:对象是类的实例。通过使用类创建一个对象,可以访问类中的属性和方法。 ...
阅读更多 »
WP开发教程 WordPress导师在线教程