test.php
<html><head><title>php動くの?</title></head><body><?php echo '動いてるよ!'; ?></body></html>
<html><head><title>php動くの?</title></head><body><?php echo '動いてるよ!'; ?></body></html>
wordpressで記事一覧のタイトルを出したいとき。
<?php$posts = get_posts('numberposts=0');global $post;?><?php if($posts): foreach($posts as $post): setup_postdata($post); ?><?php the_title(); ?><?php endforeach; endif;?>
numberposts=0
を5とかにすれば5件でる。
記事の日付も出したいときは
<?php the_time('Y年m月d日'); ?>
を使う。
記事へリンクをつけたいときは
<a href="<?php the_permalink(); ?>">
を使う。
return $user ? $user : false;
<?php//$_SERVER['REQUEST_METHOD'] = 'POST';//$_POST['mode'] = 'products_list';if ($_SERVER['REQUEST_METHOD'] !== 'POST') {header("HTTP/1.1 400 Bad Request");exit();}// {{{ requiresrequire_once '../require.php';require_once '../' . ADMIN_DIR . 'require.php';// }}}// {{{ generate page$mode = isset($_POST['mode']) ? $_POST['mode'] : '';$objPage = lfPageFactory($mode);$objPage->init();register_shutdown_function(array($objPage, "destroy"));$objPage->process($mode);function lfPageFactory($mode) {$prefix = 'LC_Page_Upgrade_';$file = CLASS_REALDIR . "pages/upgrade/${prefix}";$class = $prefix;switch ($mode) {case 'products_list':$file .= 'ProductsList.php';$class .= 'ProductsList';break;case 'patch_download':case 'download':case 'auto_update':$file .= 'Download.php';$class .= 'Download';break;case 'site_check':$file .= 'SiteCheck.php';$class .= 'SiteCheck';break;default:header("HTTP/1.1 400 Bad Request");GC_Util::gfPrintLog("modeの値が正しくありません。:".$mode);exit();break;}require_once $file;return new $class;}?>
<?php
ini_set( 'display_errors', 1 );
WARNING Cannot modify header information
headers already sent by(ナンチャラカンチャラ)
php?>
_