One Post at Homepage (Wordpress)

9 replies
  • WEB DESIGN
  • |
Hello,


I'm using theme called Heatmap Adsense. I would like to homepage display only 1 post. At the moment it is showing 2 posts. I changed the number in Setting -> Reading, but nothing happend. I also tried to install different plugins, but it still shows 2 post on homepage. Could someone give me some code or quick guide how to show only 1 POST for homepage.
Thanks.
#homepage #post #wordpress
  • Profile picture of the author alixwijaya
    May I see your site?
    I mean, I want to know for what you want to setting only 1 post on your site.

    May be you can setting 'A static page' and choose one page from your blog for home page.

    Ale,.
    {{ DiscussionBoard.errors[5432428].message }}
  • Profile picture of the author mandos123
    Static page is not a good solution. Any other ideas?
    Signature

    None

    {{ DiscussionBoard.errors[5434616].message }}
  • Profile picture of the author xRaiser
    check out your theme codes in index.php, may it help
    {{ DiscussionBoard.errors[5434721].message }}
  • Profile picture of the author mandos123
    I'm not good in PHP. But I copy the area, which should be changed (I guess?) Maybe someone could help..

    <?php get_header(); ?>

    <!--
    home.php
    ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->

    <!--
    Content of the page (inc comments and post details)
    ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->
    <div id="page-body-wrapper">

    <div id="content">

    <!--
    The Home Page 'Page Block'
    ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~ -->
    <?php
    = new WP_Query();
    = hmt_get_option(hmt_featured); // get the featured page option
    ('page_id=' . );

    if ((!="") && (!is_paged())) { // if a featured home page option has been specified
    // and this is is the first page of posts, then show the featured page
    (); ?>

    <!--
    The Home Page 'Page Block' content
    ~~~ -->

    <div class="featured-page-content">

    <!--
    Signature

    None

    {{ DiscussionBoard.errors[5434896].message }}
  • Profile picture of the author retroid
    try change

    new WP_Query();

    to

    new WP_Query( 'posts_per_page=1' );
    {{ DiscussionBoard.errors[5439898].message }}
    • Profile picture of the author mandos123
      Originally Posted by retroid View Post

      try change

      new WP_Query();

      to

      new WP_Query( 'posts_per_page=1' );
      Thanks for help, but it didn't changed anything :/
      Signature

      None

      {{ DiscussionBoard.errors[5440597].message }}
  • Profile picture of the author MirInfotech
    Try to check index.php file. And do the changes presented above by retroid and don't forget to back up.
    {{ DiscussionBoard.errors[5440374].message }}
  • Profile picture of the author Istvan Horvath
    You should try to get help in the right place:
    Please login
    Signature

    {{ DiscussionBoard.errors[5441464].message }}
  • Profile picture of the author frenchsquared
    you need to look at how your theme is getting those 2 post.
    It will not be unsing index.php if it is only showing 2 posts.

    Look for a home.php or a front-page.php
    {{ DiscussionBoard.errors[5441615].message }}

Trending Topics