register_sidebar(array(
'name' => 'サイドバー',
'id' => 'sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
'
));
add_theme_support('menus');
add_theme_support('post-thumbnails');
add_theme_support('automatic-feed-links');
add_theme_support('editor-style');
add_editor_style();
$custom_header_support = array(
// デフォルトのヘッダーテキストカラーを指定します。
'default-text-color' => '000',
// カスタムヘッダーの高さと幅を指定します。
'width' => 775,
'height' => 200,
// 高さを自由に決めるか否か。
'flex-height' => true,
// デフォルトで画像をランダム表示しますか?
'random-default' => true,
// ヘッダーをスタイリングするためのコールバックを指定します。
'wp-head-callback' => null,
// 管理画面でヘッダープレビューをスタイリングするためのコールバックを指定します。
'admin-head-callback' => null,
// 管理画面でヘッダープレビューを表示するために使用するコールバックを指定します。
'admin-preview-callback' => null,
);
add_theme_support('custom-header', $custom_header_support);
add_theme_support('custom-background');
function convert_z2h($content)
{
return mb_convert_kana($content, 'a', 'utf-8');
}
add_filter('the_title', 'convert_z2h');
add_filter('the_content', 'convert_z2h');
function print_page($atts)
{
extract(shortcode_atts(array(
'caption' => 'このページを印刷する',
), $atts));
$content = '' . $caption . '' . "\n";
return $content;
}
add_shortcode('printpage', 'print_page');
remove_action( 'wp_head', 'feed_links', 2 );
remove_action( 'wp_head', 'feed_links_extra', 3 );
remove_action( 'wp_head', 'rsd_link' );
remove_action( 'wp_head', 'wlwmanifest_link' );
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
remove_action( 'wp_head', 'wp_generator' );
function catch_that_image() {
global $post, $posts;
$first_img ='';
ob_start();
ob_end_clean();
$output = preg_match_all('//i', $post->post_content, $matches);
$first_img = $matches [1] [0];
if(empty($first_img)){ //Defines a default image
$first_img = "http://www.eset-store.jp/cms/resource/themes/kigyonosusume/images/noimage.jpg";
}
return $first_img;
}
?>
起業のすすめ - 起業・副業・新規ビジネスの副業学校
ページTOPへ