treehouse : what would you like to learn today?
Web Design Web Development iOS Development

WP-Trying to pull page excerpts onto my front page

  • Hi all, I am trying to pull 3 page excerpts onto my front page.
    I have been directed down the array road but I am not getting any results.
    I didnt think it would be so hard to pull data from a page?
    This is the code I have so far:
    http://wordpress.pastebin.com/fpTPYdPH
  • I am close to a solution if anyone is interested. I have got this far:
    <?php $args = array(
    'post_type' => 'page',
    'post__in' => array( 2, 5, 12 )
    );
    query_posts( $args ); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <li>
    <img src="<?php echo get_post_meta($post->ID, "serv", true);?>" class="articletitlepic" alt="" align="left" />
    <h3 class="myclass typeface-js"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
    <?php the_excerpt(); ?>
  • What is still the problem?
  • Now the title is not a link, well it works as a link but is not an a style link, it just uses a span and none of my rollovers work?
  • I can't see a problem, but just incase, try this working example of my h2 tag:
    <h2><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>