This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wp_editor_set_quality', function( $quality ) { | |
return 100; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* アーカイブページのクエリ操作 */ | |
function myPreGetPosts( $query ) { | |
if ( is_admin() || ! $query->is_main_query() ){ | |
return; | |
} | |
if ( $query->is_archive() ) { //月別、年別、日別、時間別アーカイブの場合はis_date() | |
$query->set('cat', '-1, -2, -3'); //IDを除外 複数はカンマで区切る マイナスでなければカテゴリ指定 | |
$query->set('posts_per_page', 30); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dl> | |
<?php $newslist = get_posts('numberposts=0&category=1,2'); | |
//numberposts=0で全ての記事、0以外で記事件数設定。category=カテゴリIDで指定カテゴリのみ表示(カンマ区切り) | |
foreach( $newslist as $post ): | |
setup_postdata( $post ); | |
?> | |
<dt> <?php the_time('Y年n月j日'); ?></dt> | |
<dd> <a href="<?php the_permalink(); ?>"> <?php the_title(); ?></a> </dd> | |
<?php endforeach; wp_reset_postdata(); ?> | |
</dl> |