06
February
静的html内でWPのphpを出力したい CPI KDDI
CPI
AddHandler x-httpd-php528 .php .html
.htaccsessに↑を書き込む
phpのあとのヴァージョン(数字)は新しいのに変更するとよい
http://acesr.document.secure.ne.jp/tools/php/
PR
<?php $paged = get_query_var('paged'); ?> <?php query_posts("cat=1&posts_per_page=10&paged=$paged"); ?> <?php if (have_posts()) : while(have_posts()) : the_post(); ?> … <?php endwhile; ?> <?php else: ?> <?php endif; ?>
/**
* カテゴリ一覧ウィジェットから特定のカテゴリを除外
*
* @param 'widget_categories_args'(フィルタ名)
* @param 'my_theme_catexcept'(呼び出す関数名※任意)
* @param 10(優先度)
* @param 1(関数に渡す引数の数※1なので省略可)
*/
add_filter(
'widget_categories_args'
,
'my_theme_catexcept'
,10);
function
my_theme_catexcept(
$cat_args
){
$exclude_id
=
'7'
;
// 除外するカテゴリID
$cat_args
[
'exclude'
] =
$exclude_id
;
// 除外
return
$cat_args
;
}