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打开速度非常慢的解决办法》的一些看法。更多内容请查看本栏目更多内容!
代码如下:<?php/*在根目录 -> wp-content -> themes 下创立mytheme文件夹用来寄存创立新主题模板 在mythem...
我想这对沙发同窗不太偏心吧。昨天在看yinheli同窗的《鼠标悬浮完成显示留言内容》一文(倡议看看,好文章)...
本文实例讲述了Wordpress分类,标签,分页显示及翻页呈现404谬误的处理办法。分享给大家供大家参考。详细剖析...
要害字形容:引见 性能 治理 评论 渣滓 审核 能够 网站 Akismet 编辑 如今咱们来看看评论治理性能。评论是...
query posts是一个十分好用的调用文章函数,能够做到同页面内显示多种特定范畴的文章,例如能够调用某分类、...
WordPress主题教程之修正wordpress回复评论文字办法,首选需求建设个自定义的评论模板,而后经过调用此...