首页
统计
分类
tags
推荐
WordPress
Linux
Search
1
快速部署Xray V2ray SS Trojan Trojan-go七合一共存一键脚本+伪装博客
189 阅读
2
国外12个免费的DNS
138 阅读
3
让你的WP跑得更快 - WordPress优化指南
82 阅读
4
github 网页的新字体 -apple-system BlinkMacSystemFont 是什么
80 阅读
5
BBR Plus一键安装脚本 BBR/BBR Plus/魔改BBR/锐速(LotServer)四合一
77 阅读
Wordpress
Linux
Other
登录
Search
标签搜索
wordpress
SSR
LNMP
bbr
SSR - Bash
flashfxp
Facebook messenger
brotli
WooCommerce
Deepin
V2Ray
BBR Plus
yum
宝塔
SQLite
谷歌云
debian
Contact Form 7
reCAPTCHA
Ruinous
累计撰写
79
篇文章
累计收到
0
条评论
首页
栏目
Wordpress
Linux
Other
页面
统计
分类
tags
推荐
WordPress
Linux
搜索到
32
篇与
的结果
2025-03-20
WordPress后台菜单怎么创建产品文章类型
只需要将以下的函数代码粘贴到你的模板函数文件functions.php即可实现。`// Register Custom Post Typefunction products_post_type() {$labels = array('name' => _x( '产品', 'Post Type General Name', 'text_domain' ),'singular_name' => _x( '产品', 'Post Type Singular Name', 'text_domain' ),'menu_name' => __( '产品', 'text_domain' ),'name_admin_bar' => __( '产品', 'text_domain' ),'archives' => __( 'Item Archives', 'text_domain' ),'attributes' => __( 'Item Attributes', 'text_domain' ),'parent_item_colon' => __( 'Parent Product:', 'text_domain' ),'all_items' => __( '所有产品', 'text_domain' ),'add_new_item' => __( '发布新产品', 'text_domain' ),'add_new' => __( '发布新产品', 'text_domain' ),'new_item' => __( '创建分类', 'text_domain' ),'edit_item' => __( '编辑产品', 'text_domain' ),'update_item' => __( '更新产品', 'text_domain' ),'view_item' => __( '查看产品', 'text_domain' ),'view_items' => __( '查看分类', 'text_domain' ),'search_items' => __( '搜索产品', 'text_domain' ),'not_found' => __( '暂无产品', 'text_domain' ),'not_found_in_trash' => __( '暂无产品', 'text_domain' ),'featured_image' => __( '产品封面图', 'text_domain' ),'set_featured_image' => __( '设置封面图', 'text_domain' ),'remove_featured_image' => __( '删除封面图', 'text_domain' ),'use_featured_image' => __( '设置为封面图', 'text_domain' ),'insert_into_item' => __( 'Insert into item', 'text_domain' ),'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),'items_list' => __( 'Items list', 'text_domain' ),'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),'filter_items_list' => __( 'Filter items list', 'text_domain' ),);$args = array('label' => __( 'Product', 'text_domain' ),'description' => __( 'Product information pages.', 'text_domain' ),'labels' => $labels,'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'custom-fields' ),'taxonomies' => array( 'category', 'post_tag' ),'hierarchical' => false,'public' => true,'show_ui' => true,'show_in_menu' => true,'menu_position' => 5,'show_in_admin_bar' => true,'show_in_nav_menus' => true,'can_export' => true,'has_archive' => true,'exclude_from_search' => false,'publicly_queryable' => true,'capability_type' => 'page',);register_post_type( 'product', $args );}add_action( 'init', 'products_post_type', 0 );` 以上就是WordPress后台菜单创建产品文章类型的方法,需要的小伙伴快去试下吧。
2025年03月20日
3 阅读
0 评论
0 点赞
2024-07-16
Elementor 添加谷歌代码
1.选择Elementor,点击custom code选项,Add new;2.输入HeadCustomCode标记为头部自定义代码,选择Location为head,复制并粘贴代码至代码区,Publish即可;3.选择 include >>> Entire Site;4.同理,noscript也这样安装,新建BodyCustomCode,按照上述填入noscript代码,Publish,并选择全站即可。
2024年07月16日
17 阅读
0 评论
0 点赞
2024-03-04
wordpress 禁止 wp-json
直接将代码放置到当前主题 functions.php 文件中添加以下代码`//禁用 REST API、移除 wp-jsonadd_filter('rest_enabled', '_return_false');add_filter('rest_jsonp_enabled', '_return_false');remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );` 最好在robots.txt里面禁止wp-json抓取;`User-agent: *Disallow: /wp-admin/Disallow: /wp-content/Disallow: /wp-includes/Disallow: //comment-page-Disallow: /?replytocom=Disallow: /category/*/page/Disallow: /tag/*/page/Disallow: /*/trackbackDisallow: /feedDisallow: /*/feedDisallow: /comments/feedDisallow: /?s=*Disallow: //?s=\Disallow: /?Disallow: /?pDisallow: /attachment/Disallow: /wp-json/Sitemap: http://www.*.com/sitemap_1.xml`
2024年03月04日
26 阅读
0 评论
0 点赞
2024-02-20
WordPress系统部署与配置—文件目录权限配置
系统根目录下权限先把所有cms文件设置540,(其他系统的文件看情况设置,不要全部540,比如nginx.conf是缓存系统生成的ngnix配置文件,在更改缓存系统功能时,需要打开写入权限)wp-content\wp-content 目录及子目录,写入权限740wp-content子目录目录下有两个目录取消写入,设置540\wp-content\themes\wp-content\plugins以上是给大家列的一个参考,这是一个常规的文件权限设置的方式。在部分情况下,比如说我们临时要去更改这个文件的时候,需要把权限再加回去,但是加完以后,正常情况下如果我们确保不会再对线上的文件作出更改的时候那么这个权限应该与以上给出的参考保持一致。为什么有一些目录需要写入权限?因为content下有一些是存附件的目录,所以它需要写入权限。这个themes和plugins是放主题和插件的,如果正常情况下,如果运行稳定,也不需要进行功能迭代的时候,应该是要取消这两个文件的写入权限。设置正确的文件权限可以避免系统在出现一些不可预知的漏洞的时候被恶意上传文件这个问题。
2024年02月20日
22 阅读
0 评论
0 点赞
2023-12-05
Redis缓存配置大揭秘:多站点WordPress轻松加速指南
嘿,各位站长朋友们,今天,我要为你们带来一篇有趣的文章,教你们如何在同一台服务器上运行多个WordPress站点时,聪明地配置Redis缓存,以提升你的网站性能。不再让你的服务器像一只慢吞吞的乌龟,跟我来,一起加速你的网站吧!一安装Redis二安装PHP Redis扩展三WordPress安装Redis插件进入WordPress的管理后台,搜索插件“Redis Object Cache”,然后安装它四设置Redis多站点配置如果你的服务器只运行一个站点,这一步其实可以跳过,但为了保险起见,我建议就算只有一个站点也进行一下设置。使用宝塔面板找到每个站点目录下的“wp-config.php”文件,然后点击编辑。在文件头部的注释下方,添加以下代码:define('WP_CACHE_KEY_SALT', 'longm_vip'); define('WP_REDIS_SELECTIVE_FLUSH', true); 第一行是为Redis缓存设置一个独特的前缀,这样就不会与其他站点混淆。建议使用你的网站域名好区分,不需要添加http前缀,比如我的是“longm_vip”。本来_想写.的,但是.在php代码中可能出错,还是用_吧!毕竟只是好区分就行了!第二行的意义在于,当刷新Redis缓存时,是刷新当前站点还是全部站点。将其设置为true,表示只刷新当前站点。五WordPress启用Redis缓存打开第二个站点的/wp-content/plugins/redis-cache/includes/object-cache.php搜索:database,大概在第629行,把“0”改成1-15的任意数。修改完重启Redis即可如果Redis数据库中已有冲突数据无法进入后台。可以进入服务器目录,把wp-content下面的这个缓存文件object-cache.php删掉,就可以恢复访问后台了。
2023年12月05日
38 阅读
0 评论
1 点赞
1
2
...
7