SlideShare uma empresa Scribd logo
1 de 56
Baixar para ler offline
@uemera
WordPress php
@uemera
uemura


https://paiza.io
<?php
$age = 21;
if( $age >= 20 ){
echo " ";
} else {
echo " ";
}
?>
START
END
<?php
$age = 21;
if( $age >= 20 ){
echo " ";
} else {
echo " ";
}
?>
<?php
$age = 21;
if( $age >= 20 ):
echo " ";
else:
echo " ";
endif;
?>
if 2
<?php
$age = 21
if( age >= 20 ){
echo " ";
else {
echo " ";
}
?>
<?php
$age = 21
if( age >= 20 ){
echo " ";
else {
echo " ";
}
?>
<?php
$count = 1;
while( $count <= 10 ):
echo $count . "n";
$count++;
endwhile;
?>
$count++
echo	$count
START
END
$count	=	1
while( $count <= 10 ):
endwhile;
while( 2 <= 10 ):
while( 2 ):
while( “a” ):
while( -1 ):
while( true ):
while( “false” ):
while( 11 <= 10 ):
while( 0 ):
while( “” ):
while( false ):
while( 0 <= $a && $a <= 10 ):
while( $a == 1 || $a == 2 ):
while( $a != 1 ):
while( ! $a ):
<?php
$count = 1;
while( $count <= 10 ):
$ans = multiply_func($count);
echo $ans . "n";
$count++;
endwhile;
function multiply_func( $num ){
$num = $num * $num;
return $num;
}
?>
index.php
header.php
footer.php
sidebar.php
<?php

get_header(); ?>

<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>
<?php

get_header(); ?>

<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>
<?php

get_header(); ?>

<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->

<?php get_sidebar(); ?>

<?php get_footer(); ?>
while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;
while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;
https://wpdocs.osdn.jp/
while ( have_posts() ) : the_post();

get_template_part( 'template-parts/content', get_post_format() );

endwhile;
START
END
get_template_part()
the_post()
get_template_part( 'template-parts/content', get_post_format() );
get_template_part( 'template-parts/content', false );
get_template_part( 'template-parts/content', false );
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<header class="entry-header">

<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>

<span class="sticky-post"><?php _e( 'Featured', 'twentysixteen' ); ?></span>

<?php endif; ?>

<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

</header>

<?php twentysixteen_excerpt(); ?>

<?php twentysixteen_post_thumbnail(); ?>

<div class="entry-content">

<?php

the_content( sprintf(

__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),

get_the_title()

) );

?>

</div>

<footer class="entry-footer">

<?php twentysixteen_entry_meta(); ?>

<?php

edit_post_link(

sprintf(

__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),

get_the_title()

),

'<span class="edit-link">',

'</span>'

);

?>

</footer>

</article>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>

<header class="entry-header">

<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>

<span class="sticky-post"><?php _e( 'Featured', 'twentysixteen' ); ?></span>

<?php endif; ?>

<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>

</header>

<?php twentysixteen_excerpt(); ?>

<?php twentysixteen_post_thumbnail(); ?>

<div class="entry-content">

<?php

the_content( sprintf(

__( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),

get_the_title()

) );

?>

</div>

<footer class="entry-footer">

<?php twentysixteen_entry_meta(); ?>

<?php

edit_post_link(

sprintf(

__( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),

get_the_title()

),

'<span class="edit-link">',

'</span>'

);

?>

</footer>

</article>
index.php
header.php
sidebar.php
footer.php
template-parts/content.php
archive.php
header.php
sidebar.php
footer.php
template-parts/content.php
https://wpdocs.osdn.jp/
print_r( $post );
<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

print_r( $post );
get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->
<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

echo " : " . $post-> post_modified;
get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->
<div id="primary" class="content-area">

<main id="main" class="site-main" role="main">

<?php if ( have_posts() ) : ?>

<?php if ( is_home() && ! is_front_page() ) : ?>

<header>

<h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>

</header>

<?php endif; ?>



<?php

while ( have_posts() ) : the_post();

echo get_the_modified_time(‘c');
get_template_part( 'template-parts/content', get_post_format() );

endwhile;



the_posts_pagination( array(

'prev_text' => __( 'Previous page', 'twentysixteen' ),

'next_text' => __( 'Next page', 'twentysixteen' ),

'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',

) );

else :

get_template_part( 'template-parts/content', 'none' );

endif;

?>

</main><!-- .site-main -->

</div><!-- .content-area -->
@uemera uemura

Mais conteúdo relacionado

Mais procurados

How to Win the Heart of CSS Boys
How to Win the Heart of CSS BoysHow to Win the Heart of CSS Boys
How to Win the Heart of CSS Boys拓樹 谷
 
Profil penyandang masalah sosial di indonesia
Profil penyandang masalah sosial di indonesiaProfil penyandang masalah sosial di indonesia
Profil penyandang masalah sosial di indonesiaDewi Kartika
 
Understanding Social Media’s Impact on Business
Understanding Social Media’s Impact on BusinessUnderstanding Social Media’s Impact on Business
Understanding Social Media’s Impact on BusinessJared Degnan
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2raj lex
 
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-Pouchkine
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-PouchkineGlassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-Pouchkine
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-PouchkineGenevaJUG
 
Documentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizDocumentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizEdderson J. Ortiz
 
Information Management Strategy from Business and IT Viewpoints
Information Management Strategy from Business and IT ViewpointsInformation Management Strategy from Business and IT Viewpoints
Information Management Strategy from Business and IT ViewpointsMarina Kerbel
 
Php codigos interfaces fredy guzman cusihunca
Php codigos interfaces   fredy guzman cusihuncaPhp codigos interfaces   fredy guzman cusihunca
Php codigos interfaces fredy guzman cusihuncaTigger_Fred
 

Mais procurados (16)

How to Win the Heart of CSS Boys
How to Win the Heart of CSS BoysHow to Win the Heart of CSS Boys
How to Win the Heart of CSS Boys
 
Profil penyandang masalah sosial di indonesia
Profil penyandang masalah sosial di indonesiaProfil penyandang masalah sosial di indonesia
Profil penyandang masalah sosial di indonesia
 
Understanding Social Media’s Impact on Business
Understanding Social Media’s Impact on BusinessUnderstanding Social Media’s Impact on Business
Understanding Social Media’s Impact on Business
 
New 3
New  3New  3
New 3
 
Alaindavila
AlaindavilaAlaindavila
Alaindavila
 
New text document (2) 2
New text document (2) 2New text document (2) 2
New text document (2) 2
 
Ratsaravolana s3
Ratsaravolana s3Ratsaravolana s3
Ratsaravolana s3
 
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-Pouchkine
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-PouchkineGlassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-Pouchkine
Glassfish3 & Java EE6 at GenevaJUG by Alexis Moussine-Pouchkine
 
Documentacion edderson callpa_ortiz
Documentacion edderson callpa_ortizDocumentacion edderson callpa_ortiz
Documentacion edderson callpa_ortiz
 
Web components v1 intro
Web components v1 introWeb components v1 intro
Web components v1 intro
 
Wp1011 Citrix Apple V004
Wp1011 Citrix Apple V004Wp1011 Citrix Apple V004
Wp1011 Citrix Apple V004
 
Information Management Strategy from Business and IT Viewpoints
Information Management Strategy from Business and IT ViewpointsInformation Management Strategy from Business and IT Viewpoints
Information Management Strategy from Business and IT Viewpoints
 
Codigo html
Codigo htmlCodigo html
Codigo html
 
Acm
AcmAcm
Acm
 
Php codigos interfaces fredy guzman cusihunca
Php codigos interfaces   fredy guzman cusihuncaPhp codigos interfaces   fredy guzman cusihunca
Php codigos interfaces fredy guzman cusihunca
 
Template ku
Template kuTemplate ku
Template ku
 

Mais de Takashi Uemura

WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくかWordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくかTakashi Uemura
 
さくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLTさくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLTTakashi Uemura
 
WAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんかWAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんかTakashi Uemura
 
アイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったかアイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったかTakashi Uemura
 
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話Takashi Uemura
 
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!Takashi Uemura
 
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニックWordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニックTakashi Uemura
 
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!Takashi Uemura
 
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めようTakashi Uemura
 
WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013Takashi Uemura
 
WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介Takashi Uemura
 
WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介Takashi Uemura
 
What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6Takashi Uemura
 
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!Takashi Uemura
 
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜Takashi Uemura
 
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解するWordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解するTakashi Uemura
 
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」Takashi Uemura
 
WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編Takashi Uemura
 
WordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるあるWordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるあるTakashi Uemura
 
WordPress実践 導入からカスタマイズまで
WordPress実践 導入からカスタマイズまでWordPress実践 導入からカスタマイズまで
WordPress実践 導入からカスタマイズまでTakashi Uemura
 

Mais de Takashi Uemura (20)

WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくかWordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
WordPressを10年以上触ってきたオレがこのへんでひとこと言っておくか
 
さくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLTさくらのナレッジ5周年ナイトLT
さくらのナレッジ5周年ナイトLT
 
WAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんかWAFって言いたいだけちゃうんか
WAFって言いたいだけちゃうんか
 
アイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったかアイドル画像ギャラリーサイトを作ったあとどうなったか
アイドル画像ギャラリーサイトを作ったあとどうなったか
 
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
神戸のアイドルKOBerrieS♪の画像ギャラリーサイトを作った話
 
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
 
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニックWordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
WordPressでオリジナルサイトを作るための最初の一歩的なカスタマイズテクニック
 
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ doshirouto2014 を作ったのでこれでテーマを理解しよう!
 
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
20140214 さくらインターネットハンズオン@大阪 WordPressを始めよう
 
WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013WordPressの使えるプラグイン2013
WordPressの使えるプラグイン2013
 
WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介WordPress 多言語化プラグインqTranslateの紹介
WordPress 多言語化プラグインqTranslateの紹介
 
WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介WordPressテーマ Foundation for WordPress の紹介
WordPressテーマ Foundation for WordPress の紹介
 
What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6What's new! TwentyThirteen + WordPress3.6
What's new! TwentyThirteen + WordPress3.6
 
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
WordPressの常識をくつがえす超簡単テーマ"doshirouto"を作ったのでこれでテーマを理解しよう!
 
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
もしWordPressユーザーがGitを使ったら 〜WordPressテーマを共同編集しよう〜
 
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解するWordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
WordPress初心者からの脱出! カスタムなんとかをちゃんと理解する
 
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
20121124 学生セミナー「基礎からわかる! IT業界とプログラミング」
 
WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編WordCampOsaka2012 闇WordCamp XOOPS編
WordCampOsaka2012 闇WordCamp XOOPS編
 
WordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるあるWordCampOsaka2012 WordPressあるある
WordCampOsaka2012 WordPressあるある
 
WordPress実践 導入からカスタマイズまで
WordPress実践 導入からカスタマイズまでWordPress実践 導入からカスタマイズまで
WordPress実践 導入からカスタマイズまで
 

WordPressのテンプレートをカスタマイズするために必要なphpを初歩から解説

  • 3.
  • 4.
  • 5.
  • 6.
  • 8. <?php $age = 21; if( $age >= 20 ){ echo " "; } else { echo " "; } ?>
  • 10. <?php $age = 21; if( $age >= 20 ){ echo " "; } else { echo " "; } ?> <?php $age = 21; if( $age >= 20 ): echo " "; else: echo " "; endif; ?> if 2
  • 11. <?php $age = 21 if( age >= 20 ){ echo " "; else { echo " "; } ?>
  • 12. <?php $age = 21 if( age >= 20 ){ echo " "; else { echo " "; } ?>
  • 13.
  • 14.
  • 15. <?php $count = 1; while( $count <= 10 ): echo $count . "n"; $count++; endwhile; ?>
  • 17. while( $count <= 10 ): endwhile;
  • 18. while( 2 <= 10 ): while( 2 ): while( “a” ): while( -1 ): while( true ): while( “false” ):
  • 19. while( 11 <= 10 ): while( 0 ): while( “” ): while( false ):
  • 20. while( 0 <= $a && $a <= 10 ): while( $a == 1 || $a == 2 ): while( $a != 1 ): while( ! $a ):
  • 21. <?php $count = 1; while( $count <= 10 ): $ans = multiply_func($count); echo $ans . "n"; $count++; endwhile; function multiply_func( $num ){ $num = $num * $num; return $num; } ?>
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 29.
  • 30. <?php
 get_header(); ?>
 <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
 <?php get_sidebar(); ?>
 <?php get_footer(); ?>
  • 31. <?php
 get_header(); ?>
 <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
 <?php get_sidebar(); ?>
 <?php get_footer(); ?>
  • 32. <?php
 get_header(); ?>
 <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
 <?php get_sidebar(); ?>
 <?php get_footer(); ?>
  • 33. while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
  • 34. while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
  • 36. while ( have_posts() ) : the_post();
 get_template_part( 'template-parts/content', get_post_format() );
 endwhile; START END get_template_part() the_post()
  • 37. get_template_part( 'template-parts/content', get_post_format() ); get_template_part( 'template-parts/content', false );
  • 39. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 <header class="entry-header">
 <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
 <span class="sticky-post"><?php _e( 'Featured', 'twentysixteen' ); ?></span>
 <?php endif; ?>
 <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
 </header>
 <?php twentysixteen_excerpt(); ?>
 <?php twentysixteen_post_thumbnail(); ?>
 <div class="entry-content">
 <?php
 the_content( sprintf(
 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
 get_the_title()
 ) );
 ?>
 </div>
 <footer class="entry-footer">
 <?php twentysixteen_entry_meta(); ?>
 <?php
 edit_post_link(
 sprintf(
 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
 get_the_title()
 ),
 '<span class="edit-link">',
 '</span>'
 );
 ?>
 </footer>
 </article>
  • 40. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
 <header class="entry-header">
 <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
 <span class="sticky-post"><?php _e( 'Featured', 'twentysixteen' ); ?></span>
 <?php endif; ?>
 <?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
 </header>
 <?php twentysixteen_excerpt(); ?>
 <?php twentysixteen_post_thumbnail(); ?>
 <div class="entry-content">
 <?php
 the_content( sprintf(
 __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
 get_the_title()
 ) );
 ?>
 </div>
 <footer class="entry-footer">
 <?php twentysixteen_entry_meta(); ?>
 <?php
 edit_post_link(
 sprintf(
 __( 'Edit<span class="screen-reader-text"> "%s"</span>', 'twentysixteen' ),
 get_the_title()
 ),
 '<span class="edit-link">',
 '</span>'
 );
 ?>
 </footer>
 </article>
  • 43.
  • 44.
  • 47. <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 print_r( $post ); get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
  • 48.
  • 49.
  • 50. <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 echo " : " . $post-> post_modified; get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
  • 51.
  • 52.
  • 53. <div id="primary" class="content-area">
 <main id="main" class="site-main" role="main">
 <?php if ( have_posts() ) : ?>
 <?php if ( is_home() && ! is_front_page() ) : ?>
 <header>
 <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
 </header>
 <?php endif; ?>
 
 <?php
 while ( have_posts() ) : the_post();
 echo get_the_modified_time(‘c'); get_template_part( 'template-parts/content', get_post_format() );
 endwhile;
 
 the_posts_pagination( array(
 'prev_text' => __( 'Previous page', 'twentysixteen' ),
 'next_text' => __( 'Next page', 'twentysixteen' ),
 'before_page_number' => '<span class="meta-nav screen-reader-text">' . __( 'Page', 'twentysixteen' ) . ' </span>',
 ) );
 else :
 get_template_part( 'template-parts/content', 'none' );
 endif;
 ?>
 </main><!-- .site-main -->
 </div><!-- .content-area -->
  • 54.
  • 55.