• Resolved ordenhjemme

    (@ordenhjemme)


    On my blog, I have a home page (called Hjem). I want this page to show a part of my last post and the titles of the last 5 posts. I think this is the index page, but how can I make the index page show up on my “Hjem” page?

    my blog is ordenhjemme.no/wordpress

    I realize that there is probalbly a very simple solution to my problem, but I can’t figure out anyhow. So if anyone can help me I would be very grateful.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Try:

    <?php
     $postslist = get_posts('numberposts=5&order=DESC&orderby=date');
     foreach ($postslist as $post) :
        setup_postdata($post);
     ?>
     <div>
     <?php the_date(); ?>
     <br />
     <?php the_title(); ?>
     <?php the_excerpt(); ?>
     </div>
     <?php endforeach; ?>
    Thread Starter ordenhjemme

    (@ordenhjemme)

    Sorry for being so ignorant, but in which fils should I copy this? Index file, css?

    Thread Starter ordenhjemme

    (@ordenhjemme)

    OK, I found out, but now for some reason in the top right corner of my fronpage shows the title and an excerpt of the lates posts. I dont want it to be there – how can I remove it?

    Looks like you have some code to add these at the bottom of index.php.

    Thread Starter ordenhjemme

    (@ordenhjemme)

    Thanks, this is most helpful, but I’m so embarrassed, because when I removed the last bit in the index, the whole right hand side bar disappeard on the front page. I must have removed too much. this is the last part of my index file now

    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(__(‘« Older Entries’, ‘minimalism’)) ?></div>
    <div class=”alignright”><?php previous_posts_link(__(‘Newer Entries »’, ‘minimalism’)) ?></div>
    </div>

    <?php else : ?>

    <h2 class=”center”><?php _e(‘Not Found’, ‘minimalism’); ?></h2>
    <p class=”center”><?php _e(‘Sorry, but you are looking for something that isn’t here.’, ‘minimalism’); ?></p>
    <?php include (TEMPLATEPATH . “/searchform.php”); ?>

    <?php endif; ?>

    </div>

    Esmi, can you help once again, I really apreciate it.

    It’s almost impossible to work out what should be there in any individual theme but you could try adding <?php get_sidebar();?> after that last </div>.

    Thread Starter ordenhjemme

    (@ordenhjemme)

    So sorry, but it did not work. The side bar is however visble at other pages/posts.

    Thread Starter ordenhjemme

    (@ordenhjemme)

    Well, the content of the sidebar has now turned ut at the bottom of the page, not on top right below the header????

    Is there any magic I can do to move it up?

    Try comparing the call to get_sidebar() in index.php to that in page.php and duplicating it.

    Thread Starter ordenhjemme

    (@ordenhjemme)

    It worked – problem solved. Thank you very much for your help.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Index page as home page’ is closed to new replies.