上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 68 下一页
网站通过Robots协议告诉搜索引擎哪些页面可以抓取,哪些页面不能抓取,这些通过robots.txt体现。 wordpress本身没有robots.txt,但是用根目录访问/robots.txt,如果服务器没有这文件的话,wordpress会自动生成一个,而这个文件可以通过后台进行开启和关闭。 方法 Read More
posted @ 2016-10-11 11:51 tinyphp Views(4660) Comments(0) Diggs(0) Edit
array_chunk(); 作用:把一个数组分割为新的数组块 用法: 实例:把数组分割为带有两个元素的数组块 输出: Read More
posted @ 2016-10-11 11:20 tinyphp Views(5823) Comments(0) Diggs(0) Edit
使用标题格式:首页(网站标题 - 网站副标题),其他页面(页面标题 | 网站标题) wp_title(分隔符,是否直接显示,分隔符显示在哪里) wp_title用在首页是没效果的,需要自己格式化一下 在后台找到头部文件head.php Read More
posted @ 2016-10-10 15:19 tinyphp Views(1235) Comments(0) Diggs(0) Edit
可以调用的文章内容: 调用文章标题:<?php the_title(); ?> 调用文章内容:<?php the_content(); ?> 调用文章摘要:<?php the_excerpt(); ?> 调用作者姓名:<?php the_author(); ?> 调用文章发布时间:<?php the Read More
posted @ 2016-10-09 15:03 tinyphp Views(3901) Comments(0) Diggs(0) Edit
is_single() 判断是否是文章页面 is_single('2')/is_single(2)判断是否是具体文章(id=2)的页面 is_single('')判断是否是具体文章(标题为Beef Stew)的页面 is_single('beef-stew')判断是否是具体文章(slug为beef- Read More
posted @ 2016-10-08 21:17 tinyphp Views(2307) Comments(0) Diggs(0) Edit
如需把css直接写在某文章,把下面代码放如function.php 大致原理:以post meta的方式在文章的发布/编辑页面添加自定义输入栏用以输入自定义的css,在文章详情页载入前述输入的css。 然后编辑文章时就会看见自定义css编辑框 输入样式试试 查看文章头部输出,成功! Read More
posted @ 2016-10-07 21:14 tinyphp Views(4686) Comments(0) Diggs(0) Edit
遇到的问题: 在主题的目录页,用wordpress默认链接方式是的,但是改了固定链接结构为:/%post_id%.html后,就访问不了了,开始以为是我主题的问题,然后切换为官方主题也是访问不了,而神奇的是空间使用的都是可以的,所以我觉得是本地环境不支持的问题。 解决方案: 1、用Dreamweav Read More
posted @ 2016-10-07 19:05 tinyphp Views(1143) Comments(0) Diggs(0) Edit
找到主题的header.php文件,然后在其<head>标签内加入加一下代码: 详细版 简单版 给指定分类定义: 这样可以给不同页面添加单独的Description 和 Keywords,有利于SEO。 Read More
posted @ 2016-10-07 18:11 tinyphp Views(6260) Comments(0) Diggs(0) Edit
调用 在主页以下方法可以调用模板中sidebar.php的内容 判断是否自定义sidebar侧边栏: 分类目录,使用wp_list_categories>>获得分类所有信息,或使用get_categories>> 最新文章: 标签: 文章归档: Read More
posted @ 2016-09-16 23:48 tinyphp Views(1528) Comments(0) Diggs(0) Edit
wordpress设置固定链接时,应该尽量注意一下几点: 1、不要让日期出现在固定链接里面。 2、不要让分类的链接出现在固定链接里面。 3、链接不要太深。 4、链接中不要出现中文。 5、文章最后可以加一个.html,一是伪静态URL搜索引擎容易收录,二是用户已经习惯了文章网址带.html了。 6、虽 Read More
posted @ 2016-09-11 09:56 tinyphp Views(3192) Comments(0) Diggs(0) Edit
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 68 下一页