• I am using the folowing to get child title and content. Each child has a gallery and a short code in the content editor in the content, but I only get the gallery and not shortcode. It isn’t something to do with the short code but rather on the content as I tried to add some paragraph to the content after the gallery and it does not show up.

    <?php $pages = get_pages('child_of='.$page->ID.'&sort_order=asc&number=3&sort_column=menu_order&parent='.$page->ID);
    foreach($pages as $page) {
        $content = $page->post_content;
    $content = apply_filters('the_content', $content);
    ?>
    
        <div class="span4">
           <h2><a href="<?php echo get_page_link($page->ID) ?>"><?php echo $page->post_title ?></a></h2>
            <?php echo $content ?>
        </div>

    I think
    $content = apply_filters('the_content', $content);
    is basically stripping out part of the content

  • The topic ‘Getting child content’ is closed to new replies.