怎样制作wordpress的面包屑导航
展开全部 如果是新手, 建议用其他Wordpress 的插件。
例如Yoast SEO 或者 WP SEO 他们都有加面包屑的功能, 如果不想加插件, 可以把以下加进function.php // Breadcrumbsfunction custom_breadcrumbs() { // Settings $separator = '>'; $breadcrums_id = 'breadcrumbs'; $breadcrums_class = 'breadcrumbs'; $home_title = 'Homepage'; // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat) $custom_taxonomy = 'product_cat'; // Get the query & post information global $post,$wp_query; // Do not display on the homepage if ( !is_front_page() ) { // Build the breadcrums echo ''; // Home page echo '' . $home_title . ''; echo ' ' . $separator . ' '; if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) { echo '' . post_type_archive_title($prefix, false) . ''; } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) { // If post is a custom post type $post_type = get_post_type(); // If it is a custom post type display name and link if($post_type != 'post') { $post_type_object = get_post_type_object($post_type); $post_type_archive = get_post_type_archive_link($post_type); echo 'labels->name . '">' . $post_type_object->labels->name . ''; echo ' ' . $separator . ' '; } $custom_tax_name = get_queried_object()->name; echo '' . $custom_tax_name . ''; } else if ( is_single() ) { // If post is a custom post type $post_type = get_post_type(); // If it is a custom post type display name and link if($post_type != 'post') { $post_type_object = get_post_type_object($post_type); $post_type_archive = get_post_type_archive_link($post_type); echo 'labels->name . '">' . $post_type_object->labels->name . ''; echo ' ' . $separator . ' '; } // Get post category info $category = get_the_category(); if(!empty($category)) { // Get last category post is in $last_category = end(array_values($category)); // Get parent any categories and create array $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),','); $cat_parents = explode(',',$get_cat_parents); // Loop through parent categories and store in variable $cat_display $cat_display = ''; foreach($cat_parents as $parents) { $cat_display .= ''.$parents.''; $cat_display .= ' ' . $separator . ' '; } } // If it's a custom post type within a custom taxonomy $taxonomy_exists = taxonomy_exists($custom_taxonomy); if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) { $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy ); $cat_id = $taxonomy_terms[0]->term_id; $cat_nicename = $taxonomy_terms[0]->slug; $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy); $cat_name = $taxonomy_terms[0]->name; } // Check if the post is in a category if(!empty($last_category)) { echo $cat_display; echo 'ID . '">ID . '" title="' . get_the_title() . '">' . get_the_title() . ''; // Else if post is in a custom taxonomy } else if(!empty($cat_id)) { echo '' . $cat_name . ''; echo ' ' . $separator . ' '; echo 'ID . '">ID . '" title="' . get_the_title() . '">' . get_the_title() . ''; } else { echo 'ID . '">ID . '" title="' . get_the_title() . '">' . get_the_title() . ''; } } else if ( is_category() ) { // Category ...
wordpress能允许用户注册博客吗
展开全部 1、选择一个好的主机 WordPress主机服务在网站性能中起着重要作用。
一个很好的共享托管服务提供商,如BlueHost或Siteground,都会针对WordPress采取额外的措施来优化您的网站的性能。
一般的网站刚起步使用共享主机就可以,但是如果网站内容比较多,使用比较大的主题比较吃内存或者访问量比较大,那么共享主机就比较吃力了。
在高流量时段,站点速度非常慢,甚至频繁的停机。
如果你的网站现在访问速度比较慢,看看你用的是什么主机,现有的配置是否够用。
如果不够的话需要升级一下主机,推荐WP Engine管理WordPress主机或者VPS 。
2、使用轻量级主题/框架 网站访问速度过慢很有可能是你的WordPress主题没有经过优化或者包含的功能太多太臃肿导致的。
很多高级主题虽然功能强大,自定义程度比较高,但是不可避免导致主题包过大,耗费资源。
像The7一类的主题,十几M的安装包,一般的虚拟主机跑起来很吃力。
如果非要使用一些高级主题推荐使用Divi 一类轻量级优化过的WordPress主题。
使用一些比较有名大公司开发的主题,尽量少用一些不知名的主题。
3、调整优化图像 网站优化中最常被忽视的方面之一是网站图片优化,我见过很多人图片不经过处理十几M的图片直接上传。
WordPress图像优化可以对页面加载时间产生最大的影响。
虽然使用高清的图片可以使我们的网站看起来很好,博客上的一些好的照片真的可以带来很多的分享和评论。
但缺点是未优化的图像通常会很大,几M甚至十几M,严重拖慢网站的访问速度。
图像很大也会占用大量HTTP请求。
一般虚拟主机是有流量限制的。
如果您的网站上有很多图片,这可能意味着更慢的页面加载时间。
因为们不是摄影网站,所以网站的内容和加载速度比图片美观更为重要。
图片的大小对网站的加速速度影响非常大,很多网站加载不完整,都是因为图片太大最后才加载出来。
我们可以在图片上传前优化调整图片尺寸,尽量不要超过1M,100-500kb最合适。
我们可以通过两种方式对图片进行优化。
第一种手动缩放和裁剪图像或者压缩 我们还可以使用无损或有损图像压缩使图片变得更小,大多数人寻找无损压缩,以确保他们的图像在他们的网站上仍然看起来效果仍然很好,即使是被压缩。
有一些工具像Photoshop一样将图片尺寸裁剪将,仍可以使用更简单的方法来完成此操作。
首先选择正确的主题 ,大部分高级主题都是“支持移动响应式设计”,它们内置的图像缩放器或图像缩放器,可以为不同的设备和屏幕尺寸创建不同的图像上传的缩略图。
第二种也是推荐使用的一种方法,使用插件自动缩放和压缩图像 我测试了5种不同的图像优化插件和服务。
让我的页面加载时间缩短了一些。
特别是与移动端。
以下是我测试过的一些但是效果都不怎么好 ●EWWW Image Optimzation Plugin(免费工具,但是每次发布新的博客文章时,会拖慢网站的速度)。
●WP Smushit(现在有免费和高级插件选项,但是免费效果不怎么明显,付费的感觉又不值这个价)。
●Kraken.io(发现没有什么效果)。
●ShortPixel(还是没什么效果)。
所有上述产品都有其优点,但是我需要一种可以压缩图像,还可以创建的缩放,裁剪和调整大小的图像的工具,这是一个非常关键的元素。
最后,经过广泛的研究,终于找到一个插件,可以满足我所有的需求。
这是一个非常强大的WordPress插件名叫Imagify,由WP Rocket研发,他们应该是最懂网站速度优化的。
用WordPress的Imagify插件连接到Imagify API服务,用于图像缩放和优化。
对于大多数博客,您可以使用完全免费Imagify,它们允许您每个月免费使用该服务多达25 MB的图像。
更重要的是,它可以非常好地优化图像。
Imagify允许您在整个网站进行批量优化,然后在加载新图像时进行单独优化。
它优化每个图像,甚至是您的主题为您创建的图像。
4.使用缓存插件 WordPress缓存插件显然是非常有用的,可以减少服务器的压力,也可以让网站的访问速度更快,所以,WordPress网站安装缓存插件是必须的 WP Super Cache 是 WordPress 官方开发人员 Donncha 开发的,是目前最高效也是最灵活的 WordPress 静态缓存插件。
它把整个网页直接生成 HTML 文件,这样 Apache 就不用解析 PHP 脚本,通过使用这个插件,能使得你的网站速度将显著的提速。
还有一个类似的插件W3 Total Cache,WP Fastest Cache 也有同样的功能,选择一个使用就可以。
还有一款付费的最强大的缓存插件Wp-Rocket ,如果对速度比较在意使用这款插件吧,绝对不会让你失望,价格也不贵每年39美金。
5、使用内容传送网络(CDN) 你过你网站受众是国外各个国家客户,那么建议使用CDN全球加速服务,保证各个国家都能顺利访问。
CDN通过复制您的网站并将其托管在世界各地的服务器上来提高您的网站速度。
比如你的网站是托管在美国,但是来自日本的人想要访问它。
如果您不使用CDN,那么来自日本的访客将不得不等待美国的服务器加载您的网站。
但是,如果您使用CDN,日本的服务器将加载您的网站,使日本访客更快地加载。
这样,无论访问者在哪里,都可...
wordpress我主题style.css没有font
展开全部 失效链接是指那些指向并不存在页面的链接。
当点击失效链接时,你到达的页面被称为404错误页面,它是当url请求不存的时候,服务器返回的一个的HTTP标准响应。
404错误和失效链接对于你的搜素引擎排名也是有负面影响的,因此主动避免失效链接的出现可以有效的高网站曝光率以及增加网站流量。
对于WordPress博客,我们可以使用下面这两种插件来处理这类失效链接。
1,用以检测网站上失效链接的插件,像失效链接检测器( Broken Links Checker)2,自动管理301转跳的插件,像Redirection插件...
GitHub 上有哪些完整的 iOS
1. Coding iOS 客户端Coding官方客户端. 笔者强烈推荐的值得学习的完整APP.GitHub - Coding/Coding-iOS: Coding iOS 客户端源代码2. OSCHINA 的 iPhone 客户端开源中国的iPhone客户端源码https://git.oschina.net/oschina/iphone-app3. Git@OSCGit@OSC iPhone 客户端,方便用户查看Git@OSC的项目以及简单的操作issue等oschina / git-osc-iphone4. Firefox for iOSGitHub - mozilla/firefox-ios: Firefox for iOS5. zulip-iosDropbox收购公司内部社交服务商Zulip,然后全部开源,这是iOS AppGitHub - zulip/zulip-ios: Zulip iOS app6. iOSSFSegmentFault官方AppGitHub - gaosboy/iOSSF: SegmentFault官方App7. iRedditReddit iPhone客户端GitHub - reddit/iReddit: The iReddit iPhone app8. MonkeyGitHub第三方iOS客户端GitHub - coderyi/Monkey: Monkey is a GitHub third party client for iOS,to show the rank of coders and repositories.9. WatchDribbble第三方客户端GitHub - tuesda/Watch: A project which demonstrate how to develop a custom client on android for dribbble.com10. Voice2Note懒人笔记iOS客户端GitHub - liaojinxing/Voice2Note: 懒人笔记iOS客户端11. RSSRead“已阅”(iOS上开源RSS新闻阅读器)GitHub - ming1016/RSSRead: “已阅”(iOS上开源RSS新闻阅读器),有兴趣?那就Pull Requests吧12. BeeFancyBeeFancy仿Fancy官方APP的WIREFRAME,基于BeeFrameworkGitHub - BeeFramework/BeeFancy: 仿Fancy官方APP的WIREFRAME,基于BeeFramework13. SXNews模仿网易新闻做的精仿网易新闻GitHub - dsxNiubility/SXNews: High imitation Neteasy News. (include list,detail,photoset,weather,feedback)14. Doppio寻找最近的星巴克GitHub - chroman/Doppio: An open source iOS app to find the nearest Starbucks store using NSURLSession, AFNetworking 2.0, Mantle and Starbucks private API.15. Anypic类似于Instagram的一款AppGitHub - ParsePlatform/Anypic: An open source mobile and web app that lets users share photos similar to Instagram16. 豆瓣相册Slowslab iOS应用 豆瓣相册 精选集 开源项目GitHub - TonnyTao/DoubanAlbum: Slowslab iOS应用 豆瓣相册 精选集 开源项目,仅供学习参考17. ChatSecure-iOSObjective-C写的XMPP聊天应用GitHub - ChatSecure/ChatSecure-iOS: ChatSecure is a free and open source encrypted chat client for iPhone and Android that supports OTR encryption over XMPP.18. NotificationChatObjective-C写的完整的聊天应用GitHub - relatedcode/EncryptedChat: This is a full native iPhone app to create realtime, text based group or private chat with Parse and Firebase.19. FakeZhihuDaily仿知乎日报iOS客户端GitHub - gnou/FakeZhihuDaily: 仿知乎日报iOS客户端20. ruby-china-for-iosRubyChina官方客户端GitHub - ruby-china/ruby-china-for-ios: Ruby China client for iOS21. Meizi豆瓣妹子图iOS客户端GitHub - Sunnyyoung/Meizi: 豆瓣妹子图iOS客户端22. PlainReader一款 iOS(iPhone + iPad) 新闻类客户端,内容抓取自 http://cnBeta.comPlainReader/PlainReader at master · guojiubo/PlainReader · GitHub23. iOS-2048用Objective-C实现的2048游戏GitHub - austinzheng/iOS-2048: iOS drop-in library presenting a 2048-style game24. ECMobile_iOS基于ECShop的手机商城客户端GitHub - GeekZooStudio/ECMobile_iOS: 基于ECShop的手机商城客户端25. wikipedia-ios维基百科官方App, 已上架GitHub - wikimedia/wikipedia-ios: The official Wikipedia iOS app.26. Sol漂亮的扁平风格的天气AppGitHub - comyarzaheri/Sol: Sol° beautifully displays weather information so you can plan your day accordingly. Check the weather in your current location or any city around the world. Implemented in Objective-C.27. v2exv2ex第三方iOS客户端v2ex/v2ex-iOS at master · singro/v2ex · GitHub28. MyOne-iOS用OC写的《一个》 iOS 客户端GitHub - meilbn/MyOne-iOS: 我的《一个》 iOS 客户端(OC)29. WNXHuntForCity高仿城觅2.0 by-objective-cGitHub - ZhongTaoTian/WNXHuntForCity: 高仿城觅by-objective-c30. viewfinder移动支付公司 Square 将去年收购的照片应用 Viewfinder 开源了,包含服务端、iOS 和 Android 应用代码GitHub - viewfinderco/viewfinder: Viewfinder client and server code31. breadwalletbreadwallet iOS bitcoin walletGitHub - voisine/breadwallet: breadwallet32. novel-design品趣iOS客户端GitHub - ltebean/novel-design: PinQu ios client33. WWDC-2014WWDC客户端GitHub - indragiek/WWDC-2014: Scholarship submission for WWDC 201434. GreatReaderGreatReader PDF阅读客户端GitHub - semweb/GreatReader: A "great" PDF reader for iOS. Available on the App Store.35. Tropos天气客户端GitHub - thoughtbot/Tropos: Weather and Forecasts for Humans36. manong-reading《猿已阅》码农周刊iOS客户端GitHub - icepy/manong-reading: 《猿...
ie8如何兼容css中的选择器:before和:checked
为了实现ridio 选中ridio 样子自动变用了input:checked + .ridio {background-image:url(../img/radio1.png);}实现,但是后来发现:checked 选择器ie8以下不能识别,最近从一个大神那发现了了一个可以使ie8版本识别css3伪类和属性选择器selectivizr,地址为http://www.zhangxinxu.com/wordpress/2010/09/selectivizr-%E8%AE%A9ie6ie7ie8%E6%94%AF%E6%8C%81css3%E4%BC%AA%E7%B1%BB%E5%92%8C%E5%B1%9E%E6%80%A7%E9%80%89%E6%8B%A9%E5%99%A8/ 实际使用时发现,ridio 选中样式不会随着点击选中而改变样子,看起来好像就没有什么作用。
后来发现,原来在ie8下我的Input隐藏了display:none;这种写法好像ie8默认不能点击,只能用filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);来透明隐藏住按钮,但是input所占的空间还是存在的,这样看起来比较丑,但是目前也没啥比较好的解决方法,只想这个样式在ie8以下使用就好,ie9以上还是用display:none;来实现。
问题来了,之前是:root来区分ie9的hack的,结果selectivizr支持了:root属性,只能换了另一种写法[html] view plain copy.hide{filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0);} @media all and (min-width:0) { .hide{display:none;} } ...
如何查看网站被bing搜索引擎收录
为网站添加必应(Bing)是否已收录查询和显示功能下面是部署方法①、编辑主题目录的functions-customize.php文件,在最后一个?>;前新增如下代码并保存:/*** WordPress 显示Bing是否收录功能* http://boaer.com/* DIY By 博艾尔企业网络策划**/function bing_check($url){global $wpdb;$post_id = ( null === $post_id ) ? get_the_ID() : $post_id;$bing_record = get_post_meta($post_id,'bing_record',true);if( $bing_record != 1){$url='http://cn.bing.com/search?q='.$url;$curl=curl_init();curl_setopt($curl,CURLOPT_URL,$url);curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);$rs=curl_exec($curl);curl_close($curl);if(!strpos($rs,'没有找到')){if( $bing_record == 0){update_post_meta($post_id, 'bing_record', 1);} else {add_post_meta($post_id, 'bing_record', 1, true);} return 1;} else {if( $bing_record == false){add_post_meta($post_id, 'bing_record', 0, true);} return 0;}} else {return 1;}}function bing_record() {if(bing_check(get_permalink()) == 1) {echo 'Bing已收录';} else {echo 'Bing未收录';}}②、编辑文章模板(一般是functions.php),在合适的位置添加如下代码并保存:刷新一下,效果就出来了。
阿里云服务器ecs怎样搭建网站
展开全部第一步:收集Xshell登陆信息登陆阿里云管理中心,点击“云服务器ECS”,点击“实例”,看到服务器信息页面,点击“管理”(如图)在此信息中查看公网IP地址2第二步:进入命令界面打开 Xshell 4 ,点击“用户身份验证”,输入主机(公网IP),'确定'后输入用户名和密码连接(如图)3第三步:更新并安装yum源#yum check-update 检查可更新的所有软件包#yum update 下载更新系统已经安装的软件包#yum install vsftpd -y 成功安装yum源4第四步:创建FTP用户#service vsftpd start 启动vsftpd#useradd -p /alidata/www/wwwroot -s /sbin/nologin koothon 添加账户(此用户名即为FTP用户名,会在home文件下生成以用户名命名的文件夹)#passwd koothon 修改密码(此密码即为FTP的连接密码)确认密码:在输入密码的时候,不显示输入的内容,两次确认密码一致就可以了#chkconfig vsftpd on 设置为开机启动5第五步:连接FTP上传文件登陆阿里云下载文件:http://market.aliyun.com/product/12-121590002-cmgj000262.html?spm=5176.7150518.1996836753.5.ngTItZ 解压后会生成一个新的名为“sh-1.4.1”文件夹;连接FTP解压得到的“sh-1.4.1”文件夹上传到根目录下;6第六步:安装环境# cd /home/username 登陆服务器进入根目录#chmod -R 777 sh-1.4.1 文件夹得安装权限# cd sh-1.4.1 进入cd sh-1.4.1目录# ./install.sh 执行安装命令Please select the web of nginx/apache, input 1 or 2 : 1(自选nginx/apache版本:1、2);Please select the nginx version of 1.0.15/1.2.5/1.4.4, input 1 or 2 or 3 : 3 (自选nginx版本:1、2、3)Please select the mysql version of 5.1.73/5.5.35/5.6.15, input 1 or 2 or 3 : 3(自选mysql版本:1、2、3);You select the version : 以下是选择的版本:web : nginxnginx : 1.4.4php : 5.5.7mysql : 5.6.15Enter the y or Y to continue:y 输入y或Y继续:Ywill be installed, wait … (环境安装中需要等待半小时左右)看到如图界面,那么恭喜你环境安装成功了!7第七步:查看环境配置和安装网站#netstat -tunpl 此命令用户查看服务及端口在sh-1.4.1目录输入 #cat account.log 就能看到ftp和mysql的密码第四步:配置自己的网站根据ftp用户名密码连接到服务器将“phpwind”程序删除,上传自己的网站程序解析已经备案域名到云服务器
转载请注明出处51数据库 » wordpress check baid
YGR一个人