• I have a wordpress site in which I want to create a blog page which will display the following things.

    The blog’s featured image in first line
    The blog title in the second line
    The blog content(text) in the third line
    The last update, comments count and posted by in the 4th line.
    How will I do this?

    Shoud I directly query the database or use some builtin functions?

    Any help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • 1- Feature Image

    <?php
    					$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
    					if ( $images ) {
    					$total_images = count( $images );
    						$image = array_shift( $images );
    						echo $image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
    						}

    2-Title

    <?php the_title();?>

    3- Content <?php the_content();?>

    4- Comments <?php comments_number( 'no responses', 'one response', '% responses' ); ?>.

    /@@@@@@@@@@@@@@@@@@@@@ Code /

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Thread Starter hmdnawazz

    (@hmdnawazz)

    I tried your code but did nor resolve the problem.
    Nothing displayed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to get the blog post's featured image, content, last modified date and comme’ is closed to new replies.