Word Press

Word Press

テスト

if ( ! defined( 'ABSPATH' ) ) { exit; }
Word Press

WordPressの管理画面(ダッシボード)に、新たなカスタムメタボックスを追加する

function add_custom_meta_box_for_products() { add_meta_box( 'custom_product_info', // メタボックスのID _...
Word Press

Word pressのfunctions.phpに記述するCSSファイルの読込

function mytheme_enqueue_styles() { wp_enqueue_style('mytheme-style',get_stylesheet_uri()); } add_action('wp_enq...
Word Press

アイキャッチ画像の機能を有効化

if ( function_exists( 'add_theme_support' ) ) { add_theme_support( 'post-thumbnails' ); } if ( function_exists( ...
Word Press

WordPress「外観」で設定したナビゲーションメニューをheader部に出力

function my_custom_theme_setup() { register_nav_menus( array( 'header_menu' => 'Header Navigation Menu', ) ); }...
Word Press

Word press管理画面に「カスタム投稿」を追加

以下のコードはECサイト構築の際に商品を登録するためのもの function create_posttype() { register_post_type( 'products', arr...
Word Press

テーマ作成時のディレクトリ構造

自分のテーマのためのフォルダ(例:mytheme)をwp-content/themesのディレクトリに作成します。 そして、そのフォルダ内に以下の基本的なファイルを作成します。 style.css→テーマ詳細・スタイルを...
Word Press

Word Press関数一覧

get_header();ヘッダーファイル(通常はheader.php)をロードする。 get_footer();フッターファイル(通常はfooter.php)をロードする。 get_sidebar();サイドバーファイル(...
タイトルとURLをコピーしました