WordPRESS single.php

Wordpress カスタム投稿タイプ ② functions.php と テンプレート.phpで設定

// カスタムポストタイプ 02function my_post_type02(){ register_post_type( 'a_shrine', array( 'label' => '神社', 'description' => '神社の情報', 'hierarchical' => false, 'public' => true, 'has_archive' => true, 'supports' => array( 'title', #…

Wordpress カスタム投稿タイプ 出力 ①

single.php ------- ○カスタム投稿タイプ、キー、値出力 <table> $value) : ?> <tr> <th></th> <td></td> </tr></table>

同じカテゴリー出力

'post', 'post_per_page' => '4', 'post__not_in' => array($post->ID), // 表示中の記事は出力対象から除外するため 'orderby' …

カスタムフィールド youtube プラグイン:Advanced Custom Fields

css .VideoWrapper { position: relative; padding-bottom: 56.25%; /* 16:9 */ padding-top: 25px; height: 0; } .VideoWrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } ----- single.php など ----- <div class="VideoWrapper"> </div>

WordPRESS single.php previous_post_link(), next_post_link()

<nav class="postNavi"> <span class="prev"> </span> <span class="next"> </span> </nav>

WordPRESS single.php テンプレート ①

<div class="container"> <div class="content"> <article<?php post_class('kiji'); ?>> <h1></h1><div class="sub-header"> <div class="bread"> <ol> <li></li></ol></div></div></article<?php></div></div>

single.php  post_class で分岐

<div class="container"> <div class="content"> <article<?php post_class('kiji'); ?>> <h1></h1> </article> </div> </div>