This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//获取ID | |
global $post; | |
$category = get_the_category($post->ID); | |
$cat_parent = get_category($category[0]->category_parent)->term_id; | |
if (!empty($cat_parent)) { | |
$cat_id = $cat_parent; //如果有父级分类,获取父级分类ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/********************************************** | |
** | |
**在主题文件夹下的functions.php中加入以下代码: | |
** | |
***********************************************/ | |
//修改字数 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
203.208.48.151 | |
203.208.46.176 | |
203.208.46.147 | |
203.208.46.148 | |
203.208.46.212 | |
203.208.46.158 | |
203.208.46.180 | |
203.208.46.198 | |
203.208.46.200 | |
203.208.41.150 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// functions.php -- Theme | |
// 方法一: | |
if (!defined('ABSPATH')) exit; | |
class Replace_Google_Fonts | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$domsxe = simplexml_load_string(get_the_post_thumbnail()); | |
$thumbnailsrc = $domsxe->attributes()->src; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*********************************** | |
* | |
* 判断指定元素是否存在 | |
* | |
* *********************************/ | |
var arr = ['a','b','c','d','e','f'] | |
var str = 'b'; | |
console.log( $.inArray(str , arr) ); | |
//结果: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* | |
* 通常使用 is_home() 函数即可判断首页,但是有时候在首页不起作用 | |
* | |
*/ | |
if( is_home() || is_front_page() ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_con(){ | |
global $post; | |
$content = get_the_content(); | |
//获取内容的第一段 | |
$str = wpautop( $content ); | |
$str = substr( $str, 0, strpos( $str, '</p>' ) + 4 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//explode用法: | |
$var = '10, 24, 29, 32, 56'; | |
$ary = explode(",", $var); | |
print_r ( $ary ); // Array ( [0] => 10 [1] => 24 [2] => 29 [3] => 32 [4] => 56 ) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eval(z='p="<"+"pre>"/* ,.oq#+ ,._, */;for(y in n="zw24l6k\ | |
4e3t4jnt4qj24xh2 x/* =<,m#F^ A W###q. */42kty24wrt413n243n\ | |
9h243pdxt41csb yz/* #K q##H######Am */43iyb6k43pk7243nm\ | |
r24".split(4)){/* dP cpq#q##########b, */for(a in t=pars\ | |
eInt(n[y],36)+/* p##@###YG=[#######y */(e=x=r=[]))for\ | |
(r=!r,i=0;t[a/* d#qg `*PWo##q#######D */]>i;i+=.05)wi\ | |
th(Math)x-= /* aem1k.com Q###KWR#### W[ */.05,0>cos(o=\ | |
new Date/1e3/* .Q#########Md#.###OP A@ , */+x/PI)&&(e[~\ | |
~(32*sin(o)*/* , (W#####Xx######.P^ T % */sin(.5+y/7))\ | |
+60] =-~ r);/* #y `^TqW####P###BP */for(x=0;122>\ |
OlderNewer