function extra_assets() {
if(is_page(666)) { // '666' 就是您心愿添加css和js的页面id
wp_enqueue_script('my-script', get_template_directory_uri().'/js地址');
wp_enqueue_style('my-style', get_template_directory_uri().'/css地址');
}
}
add_action('wp_head','extra_assets');
function more_from_category($cat_ID) {
if(in_category($cat_ID) {
$posts = get_posts('numberposts=5&category='.$cat_ID);
$output = '<h3>More from this category</h3>';
$output.= '<ul>';
foreach($posts as $post) {
$output.= '<li><a href="'.get_the_title().'">'.get_permalink.'</a></li>';
}
wp_reset_query();
$output.= '</ul>';
echo $output;
}
}
function preview_warning() {
if(is_preview()) {
echo '<p id="preview-warning">Remember, you\'re still on the Preview page!<p>';
}
}
add_action('the_content','preview_warning');
#preview-warning {
background:#800;
line-height:50px;
font-size:30px;
font-weight:bold;
text-align:center;
position:fixed;
bottom:0;
}
if(is_date()) {
//h2能够修正的。.
echo '<h2>'.the_title().'</h2>';
} else {
// ...
// else外面的代码就是您archive.php里的循环代码了。
// ...
}
function admin_favicon() {
if(is_admin()) {
echo '<link rel="shortcut icon" href="'.get_bloginfo('url').'/adminfav.ico" />';
}
}
add_action('admin_head','admin_favicon');
以上就是安达网络工作室关于《WordPress打开速度非常慢的解决办法》的一些看法。更多内容请查看本栏目更多内容!
比方, 一个做音乐的网站一定不心愿搜寻引擎收录它的存档月份, 由于没有人会经过这个来搜寻出去. 这咱们就能...
Some Chinese Please插件能够阻拦不带中文字的留言,本博客不断在用成果不错,不写入数据库,可无效地缩小s...
复制代码代码如下:<title><?php if ( is_home() ) { ?><?php bloginfo('name'); ?> | <?php bloginfo('...
本文实例讲述了WordPress文章题目链接增加正在加载中提醒的办法。分享给大家供大家参考。详细剖析如下: 咱...
wordpress完成随机文章 ralix曾公布过对于wordpress随机文章的相干插件的点评文章(“wordpress插件之...
1.文章缩略图(Post Thumbnails) WordPress 2.9 一个比拟重头的新性能就是提供了不需求自定义字段的文章缩略...