Dr. Frankenbox
Forum Replies Created
-
Forum: Themes and Templates
In reply to: Why does my theme kill line breaks?No suggestions? I can’t imagine what I’m doing wrong. I double-checked, and the filter is registered in default-filters.php:
add_filter( $filter, 'wpautop' );but it isn’t doing its job. Even if I call it directly, the <p> tags simply aren’t there:
$post = get_the_content(); // Add <p> tags since WP isn't doing it for us $post = wpautop($post); echo $post;Forum: Themes and Templates
In reply to: Why does my theme kill line breaks?I doubt that will make a difference. I’m sorry I wasn’t too clear about it at first, but the problem I’m seeing happens with the page content, which isn’t in any div shown here (though this whole page gets wrapped in a div with id=”content”). I don’t have any styles on #newsposts (yet), but I don’t have any styles defined for #post-X either. Besides all that, the problem is that the <p> tags simply aren’t there, not that they are there but without the proper spacing defined for them. I don’t think a stylesheet could fix that.
Forum: Themes and Templates
In reply to: Why does my theme kill line breaks?Certainly. It’s very simplistic. The only unusual thing about it is that for a given page – the main page – it embeds The Loop for posts as well, to display news posts on that page, underneath the regular page content. The problem I’m reporting hasn’t been observed on the main page, so that code should be irrelevant.
<?php $page = get_page($_GET['page_id']); if (!isset($page)) { include('404.php'); } else { echo "<h1>"; echo $page->post_title; echo "</h1>"; echo $page->post_content; } if ($page->post_title == "Main") { query_posts('category_name=news&posts_per_page=4'); if (!have_posts()) { /* No posts to display */ ?> <h2>No Posts Found</h2> <p> No news posts were found matching the specified criteria. </p> <?php } else { ?> <div id="newsposts"> <?php while (have_posts()) { the_post(); ?> <h2><?php the_date(); ?></h2> <h3><?php the_title(); ?></h3> <?php the_content(); ?> <?php } } ?> </div> <?php } ?>