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
<h2>一覧</h2> | |
<ul> | |
<?php $author_id = get_the_author_meta( 'ID' ); ?> | |
<?php $posts = get_posts("author=$author_id&orderby=date&post_type=post&posts_per_page=5"); ?> | |
<?php foreach( $posts as $post ) : setup_postdata($post); ?> | |
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> | |
<?php endforeach; ?> | |
<?php wp_reset_postdata(); ?> | |
</ul> |
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
<?php $users = get_users(); ?> | |
<ul> | |
<?php foreach($users as $user): ?> | |
<li><?php echo $user->display_name; ?></li> | |
<ul> | |
<?php $posts = get_posts("author=$user->ID&orderby=date&post_type=post&posts_per_page=5"); ?> | |
<?php foreach( $posts as $post ) : setup_postdata($post); ?> | |
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li> |
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
if(is_admin() && isset( $_GET['post'] )){ | |
if($_GET['post']==get_option( 'page_on_front' )){ | |
if ( locate_template( array( 'editor-style-front.css' ) ) ) { | |
add_editor_style('editor-style-front.css'); | |
}else{ | |
add_editor_style(); | |
} | |
}else{ | |
if ( locate_template( array( sprintf('editor-style-%s.css' , get_page($_GET['post'])->post_name ) ) ) ) { | |
add_editor_style(sprintf('editor-style-%s.css' , get_page($_GET['post'])->post_name )); |
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
<?php | |
function add_nav_menu_custom_class( $menu_items ) { | |
$lists = array( | |
'post_type1' => 'page_slug1', | |
'post_type2' => 'page_slug2', | |
'post_type3' => 'page_slug3', | |
'post_type4' => 'page_slug4', | |
'post_type5' => 'page_slug5', | |
'post_type6' => 'page_slug6', |
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
<?php | |
// functions.php に追記 | |
function terms($a, $b){ | |
if ( intval($a->term_order) == intval($b->term_order)) { | |
return 0; | |
} | |
return (intval($a->term_order) < intval($b->term_order)) ? -1 : 1; | |
} |
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
<?php $target_taxonomy = "taxonomy-name"; // タクソノミー名を変数に設定する ?> | |
<?php $terms = get_terms($target_taxonomy,array('hide_empty' => false, )); // 空のタームも取得できるようにする ?> | |
<?php if ( !empty( $terms ) && !is_wp_error( $terms ) ): // 空かつエラーではないか ?> | |
<ul> | |
<?php foreach ( $terms as $term ): ?> | |
<li><a href="<?php echo get_term_link($term,$target_taxonomy); ?>"><?php echo $term->name; ?></a></li> | |
<?php endforeach; ?> | |
</ul> | |
<?php endif; ?> |
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
<?php | |
public function plugins_loaded(){ | |
add_action ( 'edited_term',array($this,'save_extra_category_fileds')); // 編集画面の保存 | |
add_action ( 'created_term',array($this,'save_extra_category_fileds')); // 新規追加の保存 | |
} | |
public function init(){ | |
$args=array('public' => true,'_builtin' => false ); // builtin=false(WordPressが設定してるものは省く) | |
$output = 'names'; // or objects |
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
<?php | |
function mytheme_tinymce_settings($settings) | |
{ | |
$style_formats = array( | |
array( | |
'title' => 'タイトルにする', | |
'selector' => 'h1', | |
'classes' => 'title-headding' | |
), |
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 myposttype_rewrite() { | |
global $wp_rewrite; | |
add_rewrite_rule( | |
'contents-list/reading/blog', | |
'index.php?pagename=blog', | |
'top' | |
); | |
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(){ | |
"use strict"; | |
var subdomain = ""; | |
// レコード一覧画面イベント | |
kintone.events.on('app.record.index.show',createAppSelectBox); | |
// レコード詳細画面イベント | |
kintone.events.on('app.record.detail.show',createAppSelectBox); |
OlderNewer