milad@vip.qq.com

sadsadsadsafsdafsdgfsdgfdsgfdffdhfdghgfdhfdghfghfdghdfghdgfh

WordPress文章如何添加浏览次数

在主题文件夹下面的inc文件夹(如果没有就新建一个),新建一个postviews.php文件,然后在functions.php里面引入: require get_template_directory() . '/inc/postviews.php' 然后在文件里粘贴: <?php // function to display number of posts. // 可以在后台设置一个option来决定是否开启浏览次数 func...

Read More »

jQuery的success\error和done\fail

在jQuery里面,success和error和done,fail函数做的事情都是一样的。 success参数特定回调函数当请求顺利完成时,然后从后端获取到data作为自己传递的参数。 $.ajax({ url: "some.php", type: "POST", data: { name: "John", location: "Boston" }, success: function(data) { console.log("Success:...

Read More »

wordpress分页函数和教程

<?php /* Plugin >> Name: WP-PageNavi Plugin URI: http://lesterchan.net/portfolio/programming/php/ Description: Adds a more advanced paging navigation to your WordPress blog. Version: 2.50 Author: Lester 'GaMerZ' Chan Author URI: http://lesterchan.net */ /* Copyright 2009 Lester Chan (e...

Read More »

WP自定义的nav walker及讲解

你可以利用wp的walker class来实现自定义二级甚至mage menu菜单。 class Custom_Nav_Walker extends Walker_Nav_Menu { public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth ) ? str_repeat( "\t", $depth ) : ''; $classes = em...

Read More »

Test highlight code

add_action( 'wp_footer', function () { if (!is_admin()) { ?> <script> snowStorm.start(); snowStorm.snowFlakeWidth = 60; snowStorm.snowFlakeHeight = 60; snowStorm.flakesMax = 128; snowStorm.flakesMaxActive = 128; snowStorm.animationInterval = 30; </script> <?php } });

Read More »

WordPress主题如何添加下雪特效

添加下雪效果有很多方法,我们这里只讲用snowstorm.js来实现。 首先去Github下载snowstorm.js,或者点击这个链接下载:点击打开后点击链接另存为就可以: https://bootstrap.cc/wp-content/themes/sahifa/js/snowstorm-min.js 首先将snowstorm.js文件上传到主题下面的js文件夹,然后在functions.php里面通过wp...

Read More »