More tag ignored when displaying sub pages
-
I’m reposting this from another forum.
I know other people have had a similar problem and I’ve browsed through the forum and Codex, but I haven’t been able to solve this problem.
I’m showing sub pages on top level pages using get_pages:
<?php $pages = get_pages('child_of='.$post->ID.'&sort_column=menu_order&sort_order=asc'); $count = 0; foreach($pages as $page) { $content = $page->post_content; if(!$content) continue; $count++; $content = apply_filters('the_content', $content); $content = str_replace(']]>', ']]>', $content); ?> <div id="<?php echo $page->post_name ?>" class="page"> <h3 class="post-title"><?php echo $page->post_title ?></h3> <div class="post-body"> <?php echo $content ?> </div> </div> <?php } ?>
The problem is that
<!--more-->
gets ignored. I know of the proposed solution mentioned here, but it doesn’t work for me. I’ve tried to add the snippet in every part of the code, before the loop, inside the loop, you name it.The more tag is just displayed as paragraph:
<p><!--more--></p>
Many of the people that had similar problems weren’t using
get_pages
so I’m thinking the problem is somewhere there (or how the main content is defined inside a single page of loop).Any help? Deadline is approaching and I’ve hit a wall with this. Thank you!
- The topic ‘More tag ignored when displaying sub pages’ is closed to new replies.