WordPress调用浏览量最多文章
function record_visitors() { if (is_singular()) { global $post; $post_ID = $post->ID; if($post_ID) { $post_views = (int)…
function record_visitors() { if (is_singular()) { global $post; $post_ID = $post->ID; if($post_ID) { $post_views = (int)…
获取指定某个用户的资料信息 $user = get_user_by( 'login', 'admin8' );//获取用户admin8所有信息数组 $tellphone =$user->tellphone;//用户电话 $qqhao =$u…
默认插入图片的html结构 而我需要的图片html结构为 需要在主题function.php里添加以下代码: //去除图片高宽 add_filter( 'image_send_to_editor', 'fanly_remove_images…
wordpress 默认的时间格式是具体时间,想要改成多少天前的样式。可以使用以下代码: function timeago() { global $post; $date = $post->post_date; $time = get_po…
如何让wordpress网站显示自己个性的favicon.ico图标呢,有两种方法。 一、通过修改主题文件来实现。 把想使用的ico文件放在images文件夹里,然后在header.php里添加以下代码
调用wordpress随机文章列表
给wordpress文章见容的关键词进行自动内链,方法如下。 //自动内链 function replace_text_wps($text){ $replace = array( '微言心语' => '微言心语', '个人网站' => '个…