wordpress one post on a page

by 4 replies
5
Hello all,

Does anyone know hoe to do this? I have a page with 2 columns.

In one column, I just want the contents of 1 post.

How can this be done?

TIA
#website design #page #post #wordpress
  • I not understand your question totally . I think you need to divide your home page in two part in first part you want to display your post only.
    ok follow this method..
    First make two blocks give same width to each block.
    Now past this code in left block.
    <?php $home_text = new WP_Query('category_name=feature_prodcut');
    while ( $home_text->have_posts() ) : $home_text->the_post();?>
    <?php echo the_title();?>
    <?php echo get_the_content();?>
    <a href="<?php the_permalink();?>">Details</a>
    <?php endwhile; ?>
    this will be work for you ..If you need to show image as a thumbnail then past this code under the while() loop.

    <?php the_permalink();?>">
    <?php
    if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
    the_post_thumbnail('thumbnail');
    }
    ?>
    • [2] replies
    • Thank you for the information I was trying to get one post on a page for a theme I am working with. For a page, the theme ~only~ allows for a widget box whenever a template (using post archives) is being used.

      I had copied this template and then fixed it so that it would look for the one post (by post number). I had to hard code it in since it was not being passed from the "Customized Area" on the page. This was a bit frustrating. I just made copies of the code (I know efficient). One for each post number. There were a total of 5 - all because the setting of the value in "Customized Area" was not working.

      I got the effect that I wanted though.

      Thanks again!
    • I don't get you really please question again and again
      • [1] reply

Next Topics on Trending Feed