<?php
add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
$content = "芒果小站 - 这里不卖芒果,请另寻他处购买。";
return $content;
}
?>
$users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
echo "总共有 ".$users." 位注册用户";
<?php query_posts('meta_key=review_type&meta_value=movie'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php
function filter_where($where = '') {
$where .= " AND post_date >= '2009-01-01' AND post_date <= '2010-01-01'";
return $where;
}
add_filter('posts_where', 'filter_where');
query_posts($query_string);
?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?'.filemtime( get_stylesheet_directory().'/style.css'); ?>" >
function wcount(){
ob_start();
the_content();
$content = ob_get_clean();
return sizeof(explode(” “, $content));
}
function disableAutoSave(){
wp_deregister_script('autosave');
}
add_action( 'wp_print_scripts', 'disableAutoSave' );
function get_author_bio ($content=''){
global $post;
$post_author_name=get_the_author_meta("display_name");
$post_author_description=get_the_author_meta("description");
$html="<p class='clearfix' id='about_author'>\n";
$html.="<img width='80' height='80' class='avatar' src='http://www.gravatar.com/avatar.php?gravatar_id=".md5(get_the_author_email()). "&default=".urlencode($GLOBALS['defaultgravatar'])."&size=80&r=PG' alt='PG'/>\n";
$html.="<p class='author_text'>\n";
$html.="<h4>Author: <span>".$post_author_name."</span></h4>\n";
$html.= $post_author_description."\n";
$html.="</p>\n";
$html.="<p class='clear'></p>\n";
$content .= $html;
return $content;
}
add_filter('the_content', 'get_author_bio');
以上就是安达网络工作室关于《10 个实用的 WordPress 技巧教程 推荐收藏》的一些看法。更多内容请查看本栏目更多内容!
get_permalink()(获取文章或页面链接) get_permalink() 用来依据固定衔接前往文章或许页面的链接。在获取...
链接方式http://localhost/?go=http://www.baidu.com这种方式转跳的办法。 复制代码代码如下:add_action('w...
从WordPress后盾媒体库上传的媒体文件,不像文章那样能够给它指定分类和标签,然而很多时分咱们又需求这样的...
wordpress默许状况下,裁剪的图片会间接裁剪图片的两头局部,例如你上传了一张美女图片,上传下来因为图片的...
1.文章缩略图(Post Thumbnails) WordPress 2.9 一个比拟重头的新性能就是提供了不需求自定义字段的文章缩略...
随着 WordPress 一版一版的晋级,性能越来越多,代码量也越来越宏大,对 WordPress 速度慢的埋怨声也越来越...