Forums

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

Home Forums Back End WP3.1 – How do you exclude things like -“Posted on,” “Posted in,” “Comments Off?’

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #32765

    I want to set up a POST to display content on home page. I’ll plan to use a query-post to show only the one post, but I don’t want it to include all of the extra things that are added to the output by WordPress like: “Posted on,” “Posted in,” “Comments Off” etc…

    Is there a way I can customize this single post or the query_post/loop on index.php or home.php to accomplish this?

    This is what I set-up to display the SINGLE post on the home.php:




    // The Query
    query_posts( "p=209" );

    get_template_part( 'loop', 'index' );


    // Reset Query
    wp_reset_query();

    ?>
    #75911
    TheDoc
    Member

    Instead of doing the loop like that, you can do it like this:




    #75896

    Where can I find a reference in codex of all the different functions?

    Will I still need to use the query_posts or can it be included in Loop?




    // The Query
    query_posts( "p=209" );

    // The Loop




    // Reset Query
    wp_reset_query();

    ?>

    Would something like this work also?








    #75898
    TheDoc
    Member

    No, the query post will have to stay – though it looks like you’re trying to get the content of only one post?

    
    // The Query
    query_posts( "p=209" ); ?>






    #75899

    Yes. I just want to display one post.

    I tried this and it looks like it works okay:








    I also tried what you suggested and it looks like it works the same:


    // The Query
    query_posts( "p=209" ); ?>






    Is one method better than another?

    #75885
    TheDoc
    Member

    Not sure to be honest! I guess if you’re only pulling one post, you don’t really need to go through the loop.

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