Products
GG网络技术分享 2025-03-18 16:14 0
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无插件调用最新、热门、随机文章,具体实现代码如下,感兴趣的朋友可以参考下哈,希望对大家在新闻调用上有所帮助
调用最新文章:
<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> |
如您对本文有所疑义或者有任何需求,欢迎咨询本网站!
Demand feedback