Skip to content

Instantly share code, notes, and snippets.

@hitsujixgit
hitsujixgit / functions.php
Created June 19, 2014 10:36
コメントフォームをカスタマイズする - index.phpをカスタマイズする#7
<?php
function mytheme_comments($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment; ?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>" class="comment-wrapper">
<div class="comment-meta">
<?php echo get_avatar( $comment, $args['avatar_size']) ?>
<ul class="comment-meta-list">
<li class="comment-author-name">
@hitsujixgit
hitsujixgit / source.html
Created June 19, 2014 06:59
コメントフォームを設置する - index.phpをカスタマイズする#6
<div id="respond">
<h3 id="reply-title">コメントを残す <small>
<a rel="nofollow" id="cancel-comment-reply-link" href="/.../#respond" style="display:none;">コメントをキャンセル</a></small></h3>
<form action="http://.../wp-comments-post.php" method="post" id="commentform">
<p>メールアドレスが公開されることはありません。 <span>*</span> が付いている欄は必須項目です</p>
<p><label for="author">名前</label> <span>*</span>
<input id="author" name="author" type="text" value="" size="30" aria-required='true' /></p>
@hitsujixgit
hitsujixgit / comments.php
Created June 19, 2014 06:56
コメントフォームを設置する - index.phpをカスタマイズする#6
<?php
if (post_password_required()) {
return;
}
?>
<div id="comments">
<?php if (have_comments()) :?>
<h3 id="comments-count"><?php echo get_comments_number().' 件のコメント'; ?></h3>
<ul id="comments-list">
@hitsujixgit
hitsujixgit / index.php
Created June 19, 2014 06:55
コメントフォームを設置する - index.phpをカスタマイズする#6
<?php get_header(); ?>
<div id="content">
<?php
while(have_posts()) {
the_post();
get_template_part('content');
if( is_singular('post') ) {
comments_template();
}
} ?>
@hitsujixgit
hitsujixgit / sidebar.php
Created June 19, 2014 06:02
サイドバーを設置する - index.phpをカスタマイズする#5
<!-- sidebar -->
<aside id="sidebar">
<?php dynamic_sidebar(); ?>
</aside>
@hitsujixgit
hitsujixgit / style.css
Created June 19, 2014 06:00
サイドバーを設置する - index.phpをカスタマイズする#5
/*---------------------------------------------------------*/
/* Sidebar */
/*---------------------------------------------------------*/
.sidebar-wrapper {
margin: 0 0 15px 0;
}
.sidebar-title {
border-left: solid 10px #99c348;
font-size: 1.2em;
padding: 10px 0 10px 20px;
@hitsujixgit
hitsujixgit / functions.php
Created June 19, 2014 05:57
サイドバーを設置する - index.phpをカスタマイズする#5
<?php
//サイドバーを1つ設置する
register_sidebar(array(
'name'=>'サイドバー',
'before_widget'=>'<div class="sidebar-wrapper">',
'after_widget'=>'</div>',
'before_title' => '<h4 class="sidebar-title">',
'after_title' => '</h4>'
));
@hitsujixgit
hitsujixgit / style.css
Created June 19, 2014 04:40
テンプレートフォルダ内の画像を使用する - index.phpをカスタマイズする#3
#header #site-title-wrapper {
float: left;
}
#wplogo-image {
display: block;
float: right;
margin: 30px 10px 0;
}
ul#main-nav {
clear: both;
@hitsujixgit
hitsujixgit / header.php
Last active August 29, 2015 14:02
テンプレートフォルダ内の画像を使用する - index.phpをカスタマイズする#3
<!DOCTYPE html>
<html>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" />
<title><?php bloginfo('name'); ?></title>
</head>
<body>
<div id="container">
<!-- header -->
@hitsujixgit
hitsujixgit / footer.php
Created June 19, 2014 04:25
テンプレートパーツ化する - index.phpをカスタマイズする#2