The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS WordPress 3.1 – How can loop be modified to show only content of page?

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
  • #32999

    I’ve created a page through WP admin and I want page to only display what I put in the content area. I’m pretty sure I should use something like this – – but I’m not sure of the specifics.

    If I use the Loop from index.php (starkers) the content of the page displays but the “page name,” “posted on, “author,” “comments,” etc are all included. I just want the content from page without the other stuff.

    I’ve tried this:

    It seems to work, but I’m not sure if it’s the “correct” way to do it. I don’t want to use something sloppy if there’s a better way.

    Thank you,


    Do you think the wp_reset_query should be used?


    remove the other calls to php if you want to eliminate the author, comments, etc in index.php in any theme



    The loop in the starkers blank theme I’m using is in a file called loop.php (see below). I understand the basics of how the loop works but I’m not sure what the bare minimum I need to use to show only the content on a single page…

    Is there is a “simpler” version I can use on just one page?

    * The loop that displays posts.
    * The loop displays the posts and the post content. See
    * to understand it and
    * to understand
    * the tags used in it.
    * This can be overridden in child themes with loop.php or
    * loop-template.php, where 'template' is the loop context
    * requested by a template. For example, loop-index.php would
    * be used if it exists and we ask for the loop with:
    get_template_part( 'loop', 'index' );
    * @package WordPress
    * @subpackage Starkers
    * @since Starkers 3.0

    max_num_pages > 1 ) : ?>

    /* Start the Loop.
    * In Twenty Ten we use the same loop in multiple contexts.
    * It is broken into three main parts: when we're displaying
    * posts that are in the gallery category, when we're displaying
    * posts in the asides category, and finally all other posts.
    * Additionally, we sometimes check for whether we are on an
    * archive page, a search page, etc., allowing for small differences
    * in the loop on each template without actually duplicating
    * the rest of the loop that is shared.
    * Without further ado, the loop:
    */ ?>

    " title="" rel="bookmark">

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

    %2$s photos.', 'twentyten' ),
    'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
    ); ?>

    " title="">


    " title="" rel="bookmark">

    '' . __( 'Pages:', 'twentyten' ), 'after' => '' ) ); ?>


    $tags_list = get_the_tag_list( '', ', ' );
    if ( $tags_list ):


    max_num_pages > 1 ) : ?>


    I think I’m going to go with…

    OR THIS…

    I tested both and they seem to work the same. Are there any advantages to one over the other?


    Yeah, man. Starker’s loop.php is frigging insane. That was not what I expected at all after following Chris’s WP theme video tutorial.

    One thing I realized, though, is when Chris deleted a lot of Starker’s extra stuff, he deleted some things that might be pretty important to you… for example, the very first thing I wanted to do couldn’t be done because Chris had removed the Featured Image functionality on his Personal Homepage Theme. I had to look around for a few hours to find out how to fix that.

    BTW, in case you’re wondering, this is how you fix it… add these two lines to the top of your functions.php file under the opening set_post_thumbnail_size( 80, 55, true ); // W x H, hard crop if you want the thumbnails to automatically crop… adjust the size or just comment this line out if you want to adjust them with CSS.


    Is there an alternative to Starkers?


    Starkers is a great tool because it has everything you would need for a basic wordpress site to function on. You just need to read up on the wordpress codex some more to understand what certain functions are doing. I would suggest using this for a generic page grab in your theme.

    The query posts allows you to alter it so that you can find a certain post or posts that have the selections you want like tags, custom fields, dates etc.


    Thank you for the info.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘CSS’ is closed to new topics and replies.