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 wp_list_categories( 'title_li=&show_count=1&hide_empty=0' ); ?> | |
</ul> | |
/*----------------------------------- | |
最近の記事(5件表示) |
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 | |
/* | |
Template Name: スタッフ紹介 | |
*/ | |
?> | |
<?php get_header(); ?> | |
<main class="main"> | |
<?php if (have_posts()): while (have_posts()) : the_post(); ?> | |
<article id="post-<?php the_ID(); ?>" class="pages"> |
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 | |
/* | |
Template Name: カスタムフィールド出力用 | |
*/ | |
?> | |
<?php get_header(); ?> | |
<style> | |
.mb50{ |
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 if( get_field('フィールド名') ): ?> | |
<?php the_field('フィールド名'); ?> | |
<?php endif; ?> | |
/*テキストエリア-----------*/ | |
<?php if( get_field('フィールド名') ): ?> |
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 | |
/* | |
Template Name: 会社概要用 | |
*/ | |
?> | |
<?php get_header(); ?> | |
<main class="main"> | |
<?php if (have_posts()): while (have_posts()) : the_post(); ?> | |
<article id="post-<?php the_ID(); ?>" class="pages"> |
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 load_inline_script(){ | |
if ( function_exists( 'wp_add_inline_script' ) ) { | |
$tag = "(function($){ | |
//ここに処理を記述 | |
})(jQuery);"; | |
//この場合は「tempjs-script」下に読み込ませるという設定 | |
wp_add_inline_script('tempjs-script', $tag, 'after'); | |
} |
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
//サイトURLを定数に設定 | |
define('SITEURL', home_url()); | |
//jQueryを指定のものに変更(falseだとwp_head()に読み込む) | |
wp_deregister_script('jquery'); | |
wp_enqueue_script('jquery', SITEURL.'/js/library/jquery.min.js',array(), '', false); | |
//JSの読み込み(trueだとwp_footer()に読み込む) |
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 | |
/*----------------------------------- | |
wp_head(),wp_footer()にJS,CSSを読み込み | |
-----------------------------------*/ | |
function add_files() { | |
if ( is_admin() ) return; | |
//ここに処理を記述 | |
} |
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 | |
$args = array( | |
'post_type' => 'blog', | |
'posts_per_page' => '5' | |
); | |
$the_query = new WP_Query($args); | |
if($the_query->have_posts()): | |
echo '<ul>'; | |
while ($the_query->have_posts()) : $the_query->the_post(); | |
?> |
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 | |
$args = array( | |
'category_name' => 'news', | |
'posts_per_page' => '5' | |
); | |
$the_query = new WP_Query($args); | |
if($the_query->have_posts()): | |
echo '<ul>'; | |
while ($the_query->have_posts()) : $the_query->the_post(); | |
?> |
NewerOlder