We can do it with add_filter
function in functions.php
function append_to_the_entry_content($content) {
if (is_singular()) {
$content .= '<p class="appendix">My Appendix</p>';
}
return $content;
}
add_filter('the_content', 'append_to_the_entry_content');
Of course, using needed condition instead of is_singular()
.
If the appendix is complex it’d be convenient to fetch the content of a post or a page (which may stay unpublished).
$content .= get_post(1234)->post_content;
How you think, can we append HTML to the entry content in a smarter way?