wordpress建站:如何解决主题style.css样式浏览器缓存问题
2024年10月17日
/** * 修改文件,就更新缓存 */ function my_load_scripts($hook) { // 把文件修改时间当做版本号 $my_css_ver = date("ymd-Gis", filemtime(get_template_directory() . '/style.css')); // 加载 style.css wp_enqueue_style('style-css', get_stylesheet_
wordpress建站:如何只获取分类目录的名称(2种方法)
2024年10月17日
实现方法一: <?php $category = get_the_category(); echo $category[0]->cat_name; ?> 实现方法二: <?php foreach((get_the_category()) as $category) { echo $category->cat_name; } ?>
wordpress教程:如何利用get_calendar函数实现统计文章发布日历
2024年10月17日
如何利用get_calendar函数实现统计文章发布日历,下面web建站小编给大家简单介绍一下具体实现方法。 函数原型: get_calendar( bool $initial = true, bool $display = true ): void|string 参数说明: $initial,是否使用初始日历名称。 $display,直接显示,还是返回一个字符串。 函数源码: function get_calendar( $initial = true, $displa
后台配置同源cors解决跨域问题
2024年10月17日
所谓的同源指:域名、网络协议、端口号相同,三条有一条不同就会产生跨域。下面web建站小编给大家简单介绍一下如何完美解决前后端跨域请求问题! import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.cors.CorsConfiguration;
wordpress如何在网站上新增ajax注册登录功能
2024年10月17日
第一步,在header.php或footer.php中引入如下代码: <script type="text/javascript"> /* <![CDATA[ */ var ajax_sign_object = <?php echo ajax_sign_object(); ?>; /* ]]> */ </script> 第二步,找到functions.php文件新增以下代码: /* 获取当前页面url /* -
wordpress如何根据标签id获取文章总数
2024年10月17日
找到当前主题函数模板functions.php中新增以下代码: function get_tag_post_count_by_id( $tag_id ) { $tag = get_term_by( 'id', $tag_id, 'post_tag' ); _make_cat_compat( $tag ); return $tag->count; } 调用代码: <?php echo get_tag_post_count_by_id( $t
wordpress如何实现不同页面显示不同评论模板
2024年10月17日
函数介绍: comments_template( string $file = '/comments.php', bool $separate_comments = false ) 参数说明: $file:(字符串)(可选)要加载的文件,默认值:’/comments.php’; $separate_comments(布尔值)(可选)是否按评论类型划分评论,默认值:false。
wordpress如何在文章阅读量上新增一个基数?
2024年10月16日
在wordpress上的文章页面一般都会显示当前页面的阅读量,但是有的文章的阅读量比较少,如何在当前的阅读量上新增一个基数呢? 在内容页面搜索the_views();改成以下代码: //默认基数为500 echo (int)(500 + (int) get_post_meta( get_the_ID(), 'views', true )); //默认基数从500-999中随机生成 echo (int)(rand(500,999) + the_views(fals
wordpress建站如何利用ajax直接删除文章(移到回收站中)
2024年10月16日
wordpress建站中如何利用ajax直接删除文章(移到回收站中),下面web建站小编给大家简单介绍一下具体实现代码! 1、新建一个movepost.js文件 jQuery(function($){ $('body.post-type-post .row-actions .trash a').click(function( event ){ event.preventDefault(); var url = new URL( $(th
wordpress如何限制注册邮箱的后缀类型
2024年10月16日
wordpress建站如何某些邮箱后缀做限制,也就是说不允许部分后缀类型的邮箱注册!具体实现代码如下: 在functions.php中新增以下代码: //设置邮箱白名单 function is_valid_email_domain($login, $email, $errors ){ $valid_email_domains = array("gmail.com","qq.com");// 允许注册的邮箱信息 $valid = false; for
wordpress如何检测当前页面是否已被百度收录
2024年10月16日
wordpress如何检测当前页面是否已被百度收录,下面web建站小编给大家简单介绍一下具体实现方法! 在functions.php中新增以下代码: function baiduSL($url){ $url='http://www.baidu.com/s?wd='.$url; $curl=curl_init(); curl_setopt($curl,CURLOPT_URL,$url); curl_setopt($curl,CURLOPT_RETUR
wordpress如何利用the_author获取当前作者
2024年10月16日
如何利用wordpress中的the_author()函数获取当前作者链接,下面web建站小编给大家简单介绍一下具体实现代码! 函数原型: the_author( string $deprecated = '', bool $deprecated_echo = true ): string|null 调用方法: the_author();
wordpress优化如何获取分类描述信息(term_description)
2024年10月16日
wordpress建站seo优化的时候会用到描述,下面web建站小编给大家简单介绍一下如何利用wordpress自带的term_description函数获取分类描述信息! 函数源码: function term_description( $term = 0, $deprecated = null ) { if ( ! $term && ( is_tax() || is_tag() || is_category() ) ) { $term = g
wordpress如何调用有图片的文章
2024年10月16日
以下是基础代码,根据自己需要进行修改! <?php $rand_posts = get_posts('numberposts=8&orderby=rand'); //循环随机显示文章数 foreach( $rand_posts as $post ) : ?> <dl> <?php $litpic = get_post_meta($post->ID, 'litpic', true); if (
wordpress如何在二级目录建站(小编亲测有效)
2024年10月16日
wordpress建站如何在二级目录建站,只要两步就可以完成,下面web建站小编给大家简单介绍一下实现方法! 1、打开wp-config.php文件新增以下代码: if ( defined( 'WP_CLI' ) ) { $_SERVER['HTTP_HOST'] = '域名'; } define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/二级目录名'); define(
最新内容
1.织梦dede调用父级栏目链接和名称
2.织梦dede中通过dede:pagelist实现中英文分页效果
3.dedecms织梦实现每天首页自动更新一次的方法
4.dedecms生成文章如何把图片改成绝对路径
5.dedecms织梦系统dede:list列表新增权重排序
6.dede织梦文章keywords关键词字数限制修改方法
7.织梦dede程序出现Safe Alert: Request Error step 2!的解决
8.dedecms会员登录积分每天只限增加一次的实现思路
9.dedecms获取文章内容如何过滤掉html标签
10.dedecms如何在文章页面获取当前url链接
11.wordpress安装成功后打开页面提示500错误是什么原因
12.织梦CMS远程图片遇到https无法本地化的解决办法
13.织梦CMS UTF-8版首页文章标题显示不全的解决方案
14.Dede织梦cms列表页分页按钮不显示终极解决秘诀
15.织梦CMS图集zip压缩包上传,图片排序有问题
16.织梦CMS提示DedeTag Engine Create File False错误的解决办
17.织梦cms ueditor编辑器 七牛云存储加速
18.获取dede织梦cms当前栏目的顶级栏目名称
19.DEDE织梦CMS模板在runphp=yes的标签中调用其他field值
20.织梦cms实现调用select下拉式友情链接列表
21.织梦cms调用tags标签对应文章数量的方法
22.织梦cms相关文章likearticle显示缩略图
23.织梦cms首页从用文章中直接获取显示多张图片显示
24.织梦cms获取栏目链接typeurl失败解决方法
25.织梦cms解决webp格式图片上传失败
26.织梦cms模板分页列表显示前面和最后,中间用省略号
27.织梦dedecms百度快照劫持注入代码防范
28.织梦dedecms系统如何提高网站安全系数?
29.织梦Dedecms使用Nginx的安全设置
30.dedecms织梦TAG标签显示单个标签共有多少篇文章的
首页
上一页
3
4
5
6
7
8
9
10
11
12
13
下一页
末页