[wp-hackers] Rewriting Comments for html5 validity
Matthew Simo
matthew.a.simo at gmail.com
Mon Feb 1 20:08:26 UTC 2010
Very cool, I'll give it a look-see later this afternoon/evening.
On Mon, Feb 1, 2010 at 2:00 PM, Frank Bueltge <frank at bueltge.de> wrote:
> Maybe you will see on my project. i have also the Basis Theme in
> html5 and also write the functions for comments in html5:
>
> http://code.google.com/p/wp-basis-theme/source/browse/#svn/trunk/basis-html5
>
> Best regards
> Frank
>
>
>
>
> On Mon, Feb 1, 2010 at 8:57 PM, Matthew Simo <matthew.a.simo at gmail.com>
> wrote:
> > @ Mike - I got the desired results by using:
> >
> > <?php
> >
> wp_list_comments('style=div&callback=html5_comment&end-callback=html5_closecomment');
> > ?>
> >
> > in the comments template
> >
> > and using the following call backs:
> >
> > // Changes the trailing </li> into a trailing </article>
> > function html5_closecomment() {?>
> > </article>
> > <?php
> > }
> >
> > // This is the new comment markup - edit as you feel necessary
> > function html5_comment($comment, $args, $depth) {
> > $GLOBALS['comment'] = $comment; ?>
> >
> > <article id="comment-<?php comment_ID() ?>" <?php comment_class(); ?>>
> > <header class="comment-author vcard">
> > <?php echo get_avatar($comment,$size='48',$default='<path_to_url>' ); ?>
> > <?php printf(__('<cite class="fn">%s</cite> <span
> > class="says">says:</span>'), get_comment_author_link()) ?>
> > <p><time pubdate><a href="<?php echo htmlspecialchars( get_comment_link(
> > $comment->comment_ID ) ) ?>"><?php printf(__('%1$s at %2$s'),
> > get_comment_date(), get_comment_time()) ?></a><?php
> > edit_comment_link(__('(Edit)'),' ','') ?></time></p>
> > <p><?php echo $args ['style']; ?></p>
> > </header>
> > <?php if ($comment->comment_approved == '0') : ?>
> > <p><em><?php _e('Your comment is awaiting moderation.') ?></em></p>
> > <?php endif; ?>
> > <?php comment_text() ?>
> > <footer class="reply"><?php comment_reply_link(array_merge( $args,
> > array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></footer>
> > <?php
> > }
> >
> >
> > ----------
> >
> > I'd still like to go back through and rewrite the walker class so that it
> > will just handle the "style=article" and work like I want but for now at
> > least, this is a good, fairly strait forward solution.
> >
> > Thank for both of your ideas, they helped.
> >
> >
> > - Matthew Simo
> >
> > On Mon, Feb 1, 2010 at 1:10 PM, Mike Little <wordpress at zed1.com> wrote:
> >
> >> On 1 February 2010 18:35, Matthew Simo <matthew.a.simo at gmail.com>
> wrote:
> >>
> >> > Thanks for the replies,
> >> >
> >> > @ Mike - You are absolutely right, I added the end-callback to take
> care
> >> of
> >> > that trailing </li>, thanks! It seems wp_list_comments(); doesn't
> give
> >> any
> >> > control over the start_lvl and end_lvl, so I'm still out of luck
> there.
> >> >
> >> >
> >> There is the style argument which, if set to div (&style=div) should
> turn
> >> off the <li> tags, is that what you mean?
> >>
> >> Or would you like to be able to say start_lvl_tag=<article
> >> class="child_comment"> &end_lvl_tag=</article>? maybe add it to
> WordPress
> >> ideas http://wordpress.org/extend/ideas/
> >>
> >> Mike
> >>
> >> --
> >> Mike Little
> >> http://zed1.com/
> >> _______________________________________________
> >> wp-hackers mailing list
> >> wp-hackers at lists.automattic.com
> >> http://lists.automattic.com/mailman/listinfo/wp-hackers
> >>
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>
More information about the wp-hackers
mailing list