WordPressユーザーのbaserCMS覚え書き


コンテンツを出力する

WordPress

the_content()

テンプレートタグ/the content - WordPress Codex 日本語版

baserCMS(2系)

$bcBaser->content()

[content] コンテンツを出力する|baserCMS 2系関数リファレンス

baserCMS(3系)

$this->BcBaser->content()

[content] コンテンツを出力する|baserCMS 3系関数リファレンス

メモ

WordPressでは「ループ」と呼ばれる一連の処理の中で

<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>

というような記述をしてコンテンツを出力させますが、baserCMSでは content() を記述するだけでコンテンツを表示させることができます。

テンプレートファイルを作る上ではbaserCMSの方がシンプルといえますが、WordPressには query_posts() や get_posts() などを使って呼び出すコンテンツを細かく指定できる利点もあるので、それぞれの長所を理解しながら使い分けるとよいでしょう。