SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    the <?php correct syntax?> that pulls in posts

    hey guys , been checking the themes but cant see the right code

    on a homepage displaying the classic slider above then 3 boxes of information underneath ,
    Screen Shot 2013-10-07 at 00.22.31.jpg
    what is the correct syntax to put where ? to make the homepage template display those posts like that ??

  2. #2
    SitePoint Member
    Join Date
    Sep 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    $args = array( 'posts_per_page' => 1 );
    $lastposts = get_posts( $args );
    foreach ( $lastposts as $post ) :
    setup_postdata( $post ); ?>
    <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
    <?php the_content(); ?>
    <?php endforeach;
    wp_reset_postdata(); ?>

    this is the closest i can get to it pulling the content in , but what i need it to do is display an excerpt of it with a thumbnail as in the pic , this displays the entire message


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •