Skip to content

Commit

Permalink
Merge pull request #6 from samuelguebo/comment-thread
Browse files Browse the repository at this point in the history
Adjust comment thread and include CLI tool
  • Loading branch information
samuelguebo authored Jan 19, 2024
2 parents fe9bdb8 + f7f0688 commit 6d85b08
Show file tree
Hide file tree
Showing 22 changed files with 20,323 additions and 26 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor/
/node_modules
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.2] - 2024-01-18
- Fix comment display as thread and adjust header logo size


## [1.2.1] - 2024-01-04
- Handle edge cases: missing thumbnails and lenghty titles
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,15 @@ Unless otherwise specified, all the theme files, scripts and images are licensed
- [ScrollReveal](https://github.com/jlmakes/scrollreveal), under MIT License.
- [Roboto](https://github.com/google/roboto), under Apache License 2.0 License.

### Available CLI commands

`acajou` comes packed with CLI commands tailored for WordPress theme development :

- `npm run watch` : watches all SASS files and recompiles them to css when they change.
- `npm run compile:css` : compiles SASS files to css.
- `npm run lint:scss` : checks all SASS files against [CSS Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/).
- `npm run lint:js` : checks all JavaScript files against [JavaScript Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/).
- `npm run bundle` : generates a .zip archive for distribution, excluding development and system files.
-
# Change log
All notable changes to this theme are documented in [CHANGELOG.md](https://github.com/samuelguebo/acajou/blob/master/CHANGELOG.md) file.
9 changes: 4 additions & 5 deletions comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@

</div><!-- .nav-links -->
</nav><!-- #comment-nav-above -->
<?php endif; // Check for comment navigation. ?>
<?php endif; // Check for comment navigation ?>

<?php
$args = array(
$args = array(
'short_ping' => true,
'callback' => 'acajou_custom_comments',
);
wp_list_comments( $args);
);
wp_list_comments( $args );
?>
<!-- .comment-list -->

<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // Are there comments to navigate through? ?>
<nav id="comment-nav-below" class="navigation comment-navigation" role="navigation">
<h4 class="screen-reader-text"><?php esc_html_e( 'Comment navigation', 'acajou' ); ?></h4>
Expand Down
5 changes: 3 additions & 2 deletions css/style-blue.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style-blue.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions css/style-dark.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style-dark.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions css/style-green.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style-green.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions css/style-red.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style-red.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions css/style-yellow.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style-yellow.css.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions css/style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion css/style.css.map

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,4 +301,53 @@ function acajou_from_blog_title(){

function acajou_register_nav_menus() {
register_nav_menu( 'social', __( 'Social', 'acajou' ) );
}

/*
* Customize the comments with this fallback
*/
function acajou_custom_comments( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
echo '<div class="comment-list">';
switch( $comment->comment_type ) :
case 'pingback' :
case 'trackback' : ?>
<li <?php comment_class(); ?> id="comment<?php comment_ID(); ?>">
<div class="back-link"><?php comment_author_link(); ?></div>
<?php break;
default : ?>
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
<article <?php comment_class(); ?> class="comment">

<div class="comment-body">
<div class="author vcard">
<?php echo get_avatar( $comment, 100 ); ?>
<h6 class="author-name">
<?php comment_author_link(); ?>
</h6>
<?php comment_text(); ?>
<hr/>
<footer class="comment-footer">
<span class="date">
<?php comment_date('d/m/Y'); ?>
</span> -
<span class="time">
<?php comment_time('H:i'); ?>
</span>
<div class="reply"><?php
comment_reply_link( array_merge( $args, array(
'reply_text' => __( 'Reply', 'acajou' ),
'depth' => $depth,
'max_depth' => $args['max_depth']
) ) ); ?>
</div><!-- .reply -->
</footer><!-- .comment-footer -->
</div><!-- .vcard -->
</div><!-- comment-body -->

</article><!-- #comment-<?php comment_ID(); ?> -->
<?php // End the default styling of comment
break;
endswitch;
echo '</div>';
}
Loading

0 comments on commit 6d85b08

Please sign in to comment.