Hey guys, my developer created a site for me on Sage. Unfortunately, the paragraph breaks don’t work on posts and pages, and I have no clue why. Also my developer is on vacation for the rest of the week, then I go on vacation for 2 weeks, so I want to get this resolved before I go.
Here’s an example of it not working:
When I inspect element there are no paragraph tags. This is a theme issue as when I use 2015 theme they work. Is it something to do with base.php?
I deactivated all the plugins and the problem persists. Any help is greatly appreciated. If it’s a big problem I’m happy to pay someone to get it resolved.
That output is generated right here: https://github.com/roots/sage/blob/master/templates/content-single.php#L8
Removing hooks on
the_content will cause this problem, as would fetching the raw content from a WP_Post object and outputting that instead of fetching the filtered content. A temporary workaround would be to run it through
nl2br to at least get you some line breaks until your developer gets back to fix it, but without access to the code, it’s pretty difficult to troubleshoot from here.
If you want me to do it for you, send me a PM and I’ll let you know my rate.
Here’s my content-single.php:
<?php while (have_posts()) : the_post(); ?>
<article <?php post_class(); ?>>
<h1 class="entry-title"><?php the_title(); ?></h1>
<?php get_template_part('templates/entry-meta'); ?>
<?php the_content(); ?>
<?php wp_link_pages(['before' => '<nav class="page-nav"><p>' . __('Pages:', 'sage'), 'after' => '</p></nav>']); ?>
<?php comments_template('/templates/comments.php'); ?>
<?php endwhile; ?>
How do I run the_content through nl2br?
Sage doesn’t mess with the output of the content out of the box.
My guess is that the
wpautop filter has been removed. Obviously since it was added by your developer though, no idea where it would be.
Search the theme for this: https://codex.wordpress.org/Function_Reference/wpautop#Disabling_the_filter
Awesome, found that in functions.php. Commented it out. No clue why the dev put it in there but everything’s working now. Thanks!