33个免费且非常实用的WordPress插件(WordPress无插件调用最新、热门、随机文章实例代码)
33个免费且非常实用的WordPress插件
1.WP-PostViews - 统计页面浏览量
2.WP ULike - 为文章增加点赞功能按钮
3.Embed Any Document - 在页面嵌入文档
4.Contact Form 7 和 Contact Form CFDB7 - 在页面嵌入表单
5.Favicon Rotator - 为站点添加favicon小图标
6.All-in-One WP Migration – 整站数据迁移
7.Anti-Spam by CleanTalk – 屏蔽垃圾评论
8.Reveal Template – 显示当前页面具体哪个后台文件
9.Front Page Category – 让首页只显示制定目录的文章
10.Stealth Login Page – 屏蔽远程机器登录
11.Insert HTML Snippet – 创建html代码,用shortcode来调用执行
12.Insert PHP Code Snippet – 创建php代码,用shortcode来调用执行
13.WP Crontrol – 查看创建Cron Job
14.iThemes Security – 安全工具,比如登录超过尝试次数加入黑名单
15.Sucuri Security – 安全工具,比如查看增加或篡改的核心文件
16.batch-move – 批量调整文章的分类
17.Bulk Delete – 批量删除文章,按分类,按Tag,按文章状态
18.Broken Link Checker – 查看失效的链接
19.Captcha by BestWebSoft – 表单提交验证码
20.Ajax Load More – 瀑布流分批加载
21.Autoset Featured Image – 自动设置文章首图为特色图
22.Auto Upload Images – 自动下载外链图片到本地
23.Google XML Sitemap Generator – 生成Sitemap
24.zhanzhangb-baidu-submit - 向百度搜索引擎推送新文章
25.Media Tools – 下载外链图片到本地
26.NK Google Analytics – 加GA跟踪代码
27.Pin It Button for Pinterest – 鼠标移到图上出现pin it按钮
28.WPFront Scroll Top – 回到顶部
29.WP-PostViews – 统计文章/页面的被浏览次数
30.WP No External Links – 为外链设置no follow
31.缩略图插件 WP-Thumbnails – 图片形式展示历史文章,可按分类,按时间,或随机
32.Disable Google Fonts – 禁止调用google字体
33.WP Chinese Conversion – 简体繁体转换
备注:如非必要,少装插件!!!插件安装得越多,站点潜在的风险也越大。
WordPress无插件调用最新、热门、随机文章实例代码
WordPress无插件调用最新、热门、随机文章,具体实现代码如下,感兴趣的朋友可以参考下哈,希望对大家在新闻调用上有所帮助
调用最新文章:
<ul> <?php $post_query = new WP_Query(‘showposts=10′); while ($post_query->have_posts()) : $post_query->the_post(); $do_not_duplicate = $post->ID; ?> <li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li> <?php endwhile;?> </ul> |
调用热门文章:
<ul> <?php $post_num = 10; // 设置调用条数 $args = array( ‘post_password’ => ”, ‘post_status’ => ‘publish’, // 只选公开的文章. ‘post__not_in’ => array($post->ID),//排除当前文章 ‘caller_get_posts’ => 1, // 排除置顶文章. ‘orderby’ => ‘comment_count’, // 依评论数排序. ‘posts_per_page’ => $post_num ); $query_posts = new WP_Query(); $query_posts->query($args); while( $query_posts->have_posts() ) { $query_posts->the_post(); ?> <li><a href=”<?php the_permalink(); ?>” title=”<?php the_title(); ?>”><?php the_title(); ?></a></li> <?php } wp_reset_query();?> </ul> |
调用随机文章:
<ul> <?php global $post; $postid = $post->ID; $args = array( ‘orderby’ => ‘rand’, ‘post__not_in’ => array($post->ID), ‘showposts’ => 10); $query_posts = new WP_Query(); $query_posts->query($args); ?> <?php while ($query_posts->have_posts()) : $query_posts->the_post(); ?> <li><a href=”<?php the_permalink(); ?>” rel=”bookmark” title=”<?php the_title_attribute(); ?>”><?php the_title(); ?></a></li> <?php endwhile; ?> </ul> |
如您对本文有所疑义或者有任何需求,欢迎咨询本网站!
1. 带 [亲测] 说明源码已经被站长亲测过!
2. 下载后的源码请在24小时内删除,仅供学习用途!
3. 分享目的仅供大家学习和交流,请不要用于商业用途!
4. 本站资源售价只是赞助,收取费用仅维持本站的日常运营所需!
5. 本站所有资源来源于站长上传和网络,如有侵权请邮件联系站长!
6. 没带 [亲测] 代表站长时间紧促,站长会保持每天更新 [亲测] 源码 !
7. 盗版ripro用户购买ripro美化无担保,若设置不成功/不生效我们不支持退款!
8. 本站提供的源码、模板、插件等等其他资源,都不包含技术服务请大家谅解!
9. 如果你也有好源码或者教程,可以到审核区发布,分享有金币奖励和额外收入!
10.如果您购买了某个产品,而我们还没来得及更新,请联系站长或留言催更,谢谢理解 !
GG资源网 » 33个免费且非常实用的WordPress插件(WordPress无插件调用最新、热门、随机文章实例代码)