When WP Discourse generates a new topic for a new post, it outputs the “Published at Text” e.g. “Originally published at:” within <small> tags.
Is it possible to disable this <small> tags wrapping? It looks kinda out of place. Even better: if the post URL will be placed on a new line, a nicely polished onebox would be generated.
Yes, possibly the plugin should give some options for what template is used when a post is published to Discourse. It’s possible to customize the template that is used now. Take a look at the WP Discourse template customization topic to see how it’s done.
I like the image that you linked to. It’s possible to publish posts in that format by using a template similar to the one in this post. If you change the template in that post to this, it should give you what you are looking for.
function wpdc_custom_publish_format_html() {
ob_start();
?>
This topic is to discuss the following lesson on {blogurl}<br>
<?php
the_permalink();
$output = ob_get_clean();
return $output;
}
add_filter( 'discourse_publish_format_html', 'wpdc_custom_publish_format_html' );
You will need to select the Use Full Post Content option on the WP Discourse publishing options tab, and unselect the embed_truncate setting on Discourse for this to work.
Thanks! I just wanted to let you know your code does output the introduction text, but the permalink is pasted as text and is not generated as a onebox preview. Below code does, I hope this is of any help to other users
function wpdc_custom_publish_format_html() {
ob_start();
echo nl2br ("This topic is to discuss the following lesson:\n");
the_permalink();
$output = ob_get_clean();
return $output;
}
add_filter( 'discourse_publish_format_html', 'wpdc_custom_publish_format_html' );