Skip to content

Commit

Permalink
update to v0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
kodango committed Oct 5, 2013
1 parent a45bbc3 commit ebdb9af
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 57 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
@@ -1,3 +1,10 @@
=== versino 0.4.1 ===

* 修复: 新增主题选项默认值无效;
* 增加: 新增文章结尾标记选项, 默认为'## End Post ##';
* 修复: 相关文章插件未安装时主题出错;
* 增加: 新增评论分页导航;

=== version 0.4.0 ===

* first released version
13 changes: 11 additions & 2 deletions comments.php
Expand Up @@ -32,6 +32,7 @@
</div>

<div id="reviews">

<?php
// custom fields
$fields = array(
Expand Down Expand Up @@ -70,8 +71,16 @@
<?php wp_list_comments(array('callback' => 'dangopress_comments_callback', 'type' => 'comment', 'max_depth' => 30)); ?>
</ol>

<?php endif; ?>
<?php if (get_option('page_comments')): ?>
<div class="comment-pagenavi clearfix">
<div class="alignright">
<?php previous_comments_link('<i class="icon-circle-arrow-left"></i> 旧评论'); ?>
<?php next_comments_link('新评论 <i class="icon-circle-arrow-right"></i>'); ?>
</div>
</div>
<?php endif; ?>

<?php endif; ?>
</div>

<div id="trackbacks">
Expand All @@ -80,7 +89,7 @@
<?php foreach ($trackbacks as $comment) : ?>
<li id="comment-<?php comment_ID( ); ?>" class="trackback">
<?php comment_author_link(); ?>
<?php comment_time();?>
<small><?php comment_time();?></small>
</li>
<?php endforeach; ?>

Expand Down
23 changes: 9 additions & 14 deletions functions.php
Expand Up @@ -201,29 +201,22 @@ function dangopress_esc_callback($matches)
add_filter('the_content', 'dangopress_esc_html', 2);
add_filter('comment_text', 'dangopress_esc_html', 2);

/**
* Custom pagination function
/*
* Retrieve paginated link for archive post pages
*/
function dangopress_pagination()
function dangopress_paginate_links()
{
global $wp_query;

$total = $wp_query->max_num_pages;
$big = 999999999; // need an unlikely integer

if ( $total > 1) {
if (get_option('permalink_structure')) {
$format = 'page/%#%/';
} else {
$format = '&paged=%#%';
}

if ($total > 1) {
echo paginate_links(array(
'base' => str_replace($big, '%#%', esc_url(get_pagenum_link($big))),
'format' => $format,
'base' => str_replace($big, '%_%', esc_url(get_pagenum_link($big))),
'format' => '%#%',
'current' => max(1, get_query_var('paged')),
'total' => $total,
'mid_size' => 2,
'prev_text' => '<i class="icon-circle-arrow-left"></i>',
'next_text' => '<i class="icon-circle-arrow-right"></i>',
));
Expand Down Expand Up @@ -309,8 +302,10 @@ function dangopress_get_most_commented($posts_num = 10, $days = 60, $chars = 30)
*/
function dangopress_add_end_mark($content)
{
$options = get_option('dangopress_options');

if (is_singular()) {
return $content . '## End ##';
return $content . $options['post_end_mark'];
} else {
return $content;
}
Expand Down
2 changes: 1 addition & 1 deletion index.php
Expand Up @@ -52,6 +52,6 @@
</div>
<?php endif; ?>
</div>
<div id="post-pagenavi"><?php dangopress_pagination(); ?></div>
<div id="post-pagenavi"><?php dangopress_paginate_links(); ?></div>

<?php get_footer(); ?>
6 changes: 3 additions & 3 deletions single.php
Expand Up @@ -28,7 +28,7 @@
</div>
</div>

<?php if (related_posts_exist()): ?>
<?php if (function_exists('related_posts')): ?>
<div class="clearfix related-posts">
<h3><i class="icon-plus-sign-alt"></i><?php the_tags(' ', ', ', ' '); ?>相关的文章</h3>
<?php related_posts(); ?>
Expand All @@ -38,7 +38,7 @@
<div class="post-footer clearfix">
<div id="post-pagination" class="alignleft">
<div class="post-prev">
<span class="icon-arrow-left"></span> 上一篇:
<span class="icon-chevron-sign-left"></span> 上一篇:
<?php
$prev_post = get_previous_post();

Expand All @@ -51,7 +51,7 @@
?>
</div>
<div class="post-next">
<span class="icon-arrow-left"></span> 下一篇:
<span class="icon-chevron-sign-right"></span> 下一篇:
<?php
$next_post = get_next_post();

Expand Down
58 changes: 34 additions & 24 deletions style.css
@@ -1,13 +1,15 @@
/*
* Theme Name: dangopress
* Version: 0.4.0
* Description: kodango's presonal blog theme
* Version: 0.4.1
* Description: a simple responsive blog theme
*
* Author: kodango
* Author URI: http://kodango.com
*
* License: GNU General Public License version 3.0
* License URI: http://www.gnu.org/licenses/gpl-3.0.html
*
* Tags: white, simple, two-columns, responsive
*/
html,body,div,p,ol,ul,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,form,input,select,button,textarea,iframe,table,th,td,blockquote {
margin: 0;
Expand All @@ -23,7 +25,7 @@ body {
}

body, button, input, select, textarea {
font: normal 14px/1.8 "Helvetica Neue", "Helvetica", Arial, sans-serif;
font: normal 14px/28px "Helvetica Neue", "Helvetica", Arial, sans-serif;
}

images { border: 0 none; }
Expand Down Expand Up @@ -53,29 +55,30 @@ textarea, input {

blockquote {
display: block;
padding: 0 20px;
padding: 5px 20px;
margin: 15px 0;
vertical-align: baseline;
font-style: normal;
font-size: 12px;
}

pre {
background-color: #fefefe;
font-family: Consolas, "Liberation Mono", Courier, monospace;
background-color: #f7f7f9;
font-family: monaco, Consolas, monospace;
font-size: 12px;
border: 1px solid #ddd;
line-height: 1.6;
border: 1px solid #e1e1e8;
padding: 10px;
margin: 15px 0;
word-break: break-word;
overflow-x: scroll;
word-break: break-word;
}

code {
background-color: #eee;
border: 1px solid #ddd;
margin: 0 2px;
font-family: Consolas, "Liberation Mono", Courier, monospace;
font-family: monaco, Consolas, monospace;
font-size: 12px;
}

Expand Down Expand Up @@ -235,7 +238,6 @@ a:hover {

#site-breadcrumbs {
margin-bottom: 15px;
line-height: 1.5;
padding: 5px 0;
}

Expand Down Expand Up @@ -329,20 +331,16 @@ a:hover {
margin-top: 0;
}

.single .post {
padding-bottom: 20px;
}

.post-content ul {
margin: 15px 0;
list-style: square outside;
padding-left: 15px;
padding-left: 25px;
}

.post-content ol {
margin: 15px 0;
list-style: decimal outside;
padding-left: 20px;
padding-left: 25px;
}

.post-content ul li,
Expand Down Expand Up @@ -380,17 +378,20 @@ a:hover {
border-top: 1px solid #ddd;
}

.page-numbers {
.page-numbers,
.comment-pagenavi a {
display: inline-block;
margin: 0 5px 2px 0;
padding: 0 8px;
border: 1px solid #ddd;
color: #333;
}

.page-numbers:hover,.page-numbers.current {
.page-numbers:hover,.page-numbers.current,
.comment-pagenavi a:hover {
background: #f8f8f8;
border-bottom-color: #5895be;
text-decoration: none;
}

#sidebar {
Expand All @@ -411,7 +412,7 @@ a:hover {

.widget h3 {
color: #333;
line-height: 1.5;
font-size: 14px;
}

.widget ul {
Expand Down Expand Up @@ -440,9 +441,9 @@ ul.tabnav li {
text-align: center;
cursor: pointer;
background: #fafafa;
width: 30%;
padding: 4px;
margin-right: -1px;
width: 25.3%;
padding: 0 5px;
margin: 0 6px;
}

ul.tabnav li.selected {
Expand Down Expand Up @@ -498,8 +499,7 @@ ul.tabnav li.selected, ul.tabnav li:hover {
}

#footer p {
font-size: 12px;
line-height: 1.8;
font-size: 13px;
}

.backtop {
Expand Down Expand Up @@ -633,6 +633,12 @@ ul.tabnav li.selected, ul.tabnav li:hover {
border: 1px solid #ddd;
}

.comment-pagenavi {
margin: 15px 0;
padding: 15px 0;
border-top: 1px solid #ddd;
}

.comment-body {
padding-right: 30px;
padding-left: 70px;
Expand Down Expand Up @@ -844,6 +850,10 @@ pre .pln { color: #333; }
float: none;
}

#header {
border-bottom: none;
}

.header-menu {
padding: 5px 5%;
margin-left: -10px;
Expand Down
28 changes: 15 additions & 13 deletions theme-options.php
Expand Up @@ -9,20 +9,16 @@
function dangopress_get_options()
{
$options = get_option('dangopress_options');
$defaults = array(
'cdn_prefix' => '',
'bdshare_uid' => '',
'bdtj_siteid' => '',
'google_webid' => '',
'post_end_mark' => '## End Post ##',
);

/*
* Set default option values if first run
*/
if (!is_array($options)) {
$options = array(
'cdn_prefix' => '',
'bdshare_uid' => '',
'bdtj_siteid' => '',
'google_webid' => '',
);

update_option('dangopress_options', $options);
}
$options = wp_parse_args($options, $defaults);
update_option('dangopress_options', $options);

return $options;
}
Expand Down Expand Up @@ -95,6 +91,12 @@ function dangopress_theme_options()
</th>
<td><input name="bdtj_siteid" id="bdtj_siteid" type="text" value="<?php echo $options['bdtj_siteid']; ?>" class="regular-text code"></td>
</tr>
<tr>
<th>
<label for="post_end_mark">文章末尾标记内容</label>
</th>
<td><input name="post_end_mark" id="post_end_mark" type="text" value="<?php echo $options['post_end_mark']; ?>" class="regular-text code"></td>
</tr>
</tbody>
</table>
<input type="hidden" name="update_themeoptions" value="true" />
Expand Down

0 comments on commit ebdb9af

Please sign in to comment.