wordpress one post on a page

4 replies
  • WEB DESIGN
  • |
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
#page #post #wordpress
  • Profile picture of the author Adamlee123
    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');
    }
    ?>
    {{ DiscussionBoard.errors[9079683].message }}
    • Profile picture of the author dgmufasa
      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!
      {{ DiscussionBoard.errors[9083465].message }}
    • Profile picture of the author bonyrahman
      I don't get you really please question again and again
      {{ DiscussionBoard.errors[9084303].message }}
      • Profile picture of the author dgmufasa
        Thanks - I have solved the problem already - but

        I am using Wordpress.

        I was trying to put one post on one page for a theme I am using. The theme allows one to have a widget area but only on a page that will display posts. I have 10 posts. I did not want all 10 to be on this page - just one.

        In wordpress (for a page), I saw that there is an area: "Custom Fields". Theoretically, I should have been able to enter the PostID as a custom field so that it could be handled (accessed) from the php code of the template selected.

        But - that did not work for me. So, I had to do it in a brute-force way It works but it would have been nice if the Custom Field entered could have been passed to the PHP code. I don't know why that part did not work.
        {{ DiscussionBoard.errors[9084592].message }}

Trending Topics