I'll start by saying yes, I searched, and yes, I found an answer to this question. It's basically the solution I came up with but I want to make sure this isn't a bad solution.
Here's the real question. I want make the post title a part of the first paragraph on certain types of posts. My solution is straightforward. I call this instead of the_content
for a certain category.
function yb_link_post() {
$link_post_title = '<b class="headline"><a href="' . get_permalink() . '" title="' . get_the_title() . '">' . get_the_title() . '</a></b>';
$link_post_content = $link_post_title . ' — ' . get_the_content();
remove_filter('the_content', 'wpautop');
echo wpautop($link_post_content);
add_filter('the_content', 'wpautop');
}
So is this a bad way to do this? I have a hunch that removing and then adding wpautop
could have repercussions that I'm not considering. Can anyone tell me if this is a good solution, or if there's a smarter way to do this?