• Ok, I need to have sub-pages off my portfolio page on my website with custom fields, filling in the main infomration about website that I jhave built, but I would also like the main portfolio page to act as a summery page of all of my project, just a quick screenshot and the URL – that type of thing.

    I have built a test sub-page using custom fields but now need to do the summery page, how can I get these custom fields to appear on the summery page? Thanks in Advance

    Daniel Groves
    daniel-groves.co.uk

Viewing 1 replies (of 1 total)
  • You would need to do a query_posts(‘post_type=page’) in a Loop and a post meta function such as the_meta

    Using_Custom_Fields
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

    Here’s an example using the page.php from the WordPress Default Theme

    <?php
    /**
     * @package WordPress
     * @subpackage Default_Theme
     */
    
    get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    <?php
    
    query_posts('post_type=page&showposts=10&caller_get_posts=1');
    ?>
    		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    			<div class="entry">
    				<?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
            <?php the_meta(); ?>
    				<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
    			</div>
    		</div>
    		<?php endwhile;  ?>
    
    <?php		endif; ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

Viewing 1 replies (of 1 total)

The topic ‘Custom fields on pages’ is closed to new replies.