Upgrade to Pro — share decks privately, control downloads, hide ads and more …

本当に使えるテーマとはどのような ものかを考え続けた結果

本当に使えるテーマとはどのような ものかを考え続けた結果

Takashi Kitajima

September 17, 2016
Tweet

More Decks by Takashi Kitajima

Other Decks in Programming

Transcript

  1. <!DOCTYPE html> <html <?php language_attributes(); ?>> <head>…</head> <body <?php body_class();

    ?>> <div id="container"> <?php get_header(); ?> <div class="contents"> <main>…</main> <?php get_sidebar(); ?> </div> <?php get_footer(); ?> </div> </body> </html> #FGPSF TJOHMFQIQ
  2. $layout = 'layout/right-sidebar'; $view = 'template-parts/content/content'; Controller::set_layout( $layout ); Controller::set_view(

    $view, get_post_type() ); Controller::render(); "GUFS TJOHMFQIQ ͜ͷϝιουʹϨΠΞ΢τͱϏϡʔΛมߋͰ͖ΔϑΟϧλʔϑοΫΛ࢓ࠐΉ
  3. add_filter( 'layout', function( $layout ) { if ( 'news' ===

    get_post_type() ) { return 'layout/one-column'; } return $layout; } ); ࢠςʔϚͷGVODUJPOTQIQ