window.onload = function() {
dp.SyntaxHighlighter.ClipboardSwf = ‘http://tmh.main.jp/lib/js/dp.SyntaxHighlighter/Scripts/clipboard.swf’;
dp.SyntaxHighlighter.HighlightAll(‘code’);
};
カテゴリ別記事一覧
<ul> <?php $posts = get_posts('numberposts=4&category=1,6&orderby=modified');global $post;?> <?php if($posts): foreach($posts as $post): setup_postdata($post); ?> <li style="font-size:12px"><?php the_modified_date('m月d日'); ?><?php //the_time('m月d日'); ?>・・・<a style="font-size:12px" href=<?php the_permalink(); ?>><?php the_title(); ?></a></li> <?php endforeach; endif;?> </ul>
ログインフォーム
<li><h2>ログイン</h2> <?php if (is_user_logged_in()) : ?> Welcome! <?php global $current_user; echo $current_user->display_name ?>さん<br /> ログアウトは » <a href="<?php echo wp_logout_url() ?>&redirect_to=<?php echo esc_attr($_SERVER['REQUEST_URI']) ?>">こちら</a> <?php else : ?> <form method="post" action="<?php echo wp_login_url() ?>?redirect_to=<?php echo esc_attr($_SERVER['REQUEST_URI']) ?>"> <p><label for="login_username">ユーザー名:</label><br /> <input type="text" name="log" id="login_username" value="" /></p> <p><label for="login_password">パスワード:</label><br /> <input type="password" name="pwd" id="login_password" value="" /></p> <p><input type="submit" value="ログイン" /></p> </form> <?php endif; ?> </li>
ログイン後、管理画面にリダイレクトしないようにする
※functions.phpに記載
function mts_check_login() { global $current_user; get_currentuserinfo(); extract($current_user->wp_capabilities); if ($subscriber) { wp_redirect(get_bloginfo('url')); } } add_action('admin_init', 'mts_check_login');