Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter morayweb

    (@morayweb)

    Progress update…

    I find a loop in the docs and butchered it slightly, I now have the following, but it is showing full posts(pages) rather than just up to the <!–more–> tag, and the links have the blog url inserted twice…

    <?php if (is_page('portfolio')){?>
    		<div class="post">
    			<?php
    		    $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc');
    		    $count = 0;
    		    foreach($pages as $page)
    		    {
    		        $content = $page->post_content;
    		        if(!$content)
    		            continue;
    		        if($count >= 2)
    		            break;
    		        $count++;
    		        $content = apply_filters('the_content', $content);
    		    ?>
    	        <h2><a href=\"<?php echo get_page_link($page->ID) ?>\"><?php echo $page->post_title ?></a></h2>
    	        <div class=\"entry\"><?php echo $content ?></div>
        		<?php }?>
    		</div>
    	<?php };?>

    Any ideas how I can polish this up a little??

Viewing 1 replies (of 1 total)