# Customize the structure of WP Discourse templates

**URL:** https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754
**Category:** Administrators
**Tags:** wordpress, how-to
**Created:** [27 september 2016 om 20:31 UTC](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754 "2016-09-27T20:31:24Z")
**Posts on this page:** 1
**Showing post:** 42

<div class="post-metadata">

### Author: ![haydenjames](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haydenjames/32/255678_2.png) [@haydenjames](https://meta.discourse.org/u/haydenjames)
#### Post date: [19 april 2022 om 19:53 UTC](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754/42 "2022-04-19T19:53:58Z")

</div>

**Edit:** I got it working and pasted the correct code below for anyone else with same challenge:

@angus After some reading I found the location to override the size of gravatar on [WP Discourse](https://github.com/discourse/wp-discourse) comments.

in my **functions.php** I added this (but get error/see below):

```plaintext
// Customizes the comment_html template.

function my_wpd_comment_html( $input ) {
		ob_start();
		?>
		<li class="comment <?php echo $even ? 'even' : 'odd'; ?> depth-1">
			<article class="comment-body">
				<footer class="comment-meta">
					<div class="comment-author vcard">
						<img alt="Avatar for {username}" src="{avatar_url}" class="avatar avatar-64 photo avatar-default"
							 height="24"
							 width="24">
						<b class="fn"><a href="{topic_url}" rel="external"
										 class="url">{username}</a></b>
						<span class="says screen-reader-text"><?php echo esc_html( 'says:', 'wp-discourse' ); ?></span><!-- screen reader text -->
					</div>
					<div class="comment-metadata">
						<time datetime="{comment_created_at}">{comment_created_at}</time>
					</div>
				</footer>
				<div class="comment-content">{comment_body}</div>
			</article>
		</li>
		<?php
		$output = ob_get_clean();
 return $output;
	}

// Hook into the function from the plugin's code.
add_filter( 'discourse_comment_html', 'my_wpd_comment_html' );

```

**Edit:** it works now!  
However, I get an error 500. I don’t have display errors enabled. About to set up and do that now in a sandbox to see the syntax error. But wanted to post the code here in case it was an obvious fix.

Thanks

---

_[View the full topic](https://meta.discourse.org/t/customize-the-structure-of-wp-discourse-templates/50754)._
