<?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 技巧教程 推荐收藏》的一些看法。更多内容请查看本栏目更多内容!
本文实例讲述了WordPress后盾显示相干用户文章相干联评论的办法。分享给大家供大家参考。详细剖析如下: 将...
WordPress 3.8 开端的全新设计的后盾支持多颜色抉择,默许有八种十分精巧的配色,能够让用户本人抉择。 对...
WordPress 3.5 正式公布, 这个版本包括大量更新. 启用了最新的呼应式规划默许主题 Twenty Twelve; 改版了 A...
post_class() post_class 是 WordPress 内置的一个用于显示文章 class 称号的函数,该函数通常会为每一篇文...
有一个一劳永逸的办法能够使wordpress博主当前上传插件都不必再手动激活,wordpress主动激活,办法很简略,...
esc_attr()(过滤属性) 普通在写 Html 代码的标签属性的时分会是下边的格局: <input type="text" name="...