WordPress.org

Ready to get started?Download WordPress

Forums

How to edit archive/blog page to show full posts (8 posts)

  1. klippert
    Member
    Posted 1 year ago #

    i was wondering how you can make an achive/blog page show full blog posts instead of just the title. i am using a custom theme i made myself and i dont have an archive.php file or functions.php file i just have an index.php file and a style.css file. the code i have in my page template is `<?php
    $posts_to_show = 100; //Max number of articles to display
    $debut = 0; //The first article to be displayed
    ?><?php while(have_posts()) : the_post(); ?><h2><?php the_title(); ?></h2><ul><?php
    $myposts = get_posts("numberposts=$posts_to_show&offset=$debut");
    foreach($myposts as $post) :
    ?><li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><?php endforeach; ?>
    </ul><?php endwhile; ?>` and you can check out what i have here. also if any one knows how to i would really like to have only like 3 or 4 posts per page and then they have to hit like a next button to go to the next page of posts. thanks for any help.

  2. Aaron
    Member
    Posted 1 year ago #

    Add the below in there where you want the content.

    <?php the_content(); ?>

  3. cannon303
    Member
    Posted 1 year ago #

    where you have:
    <h2><?php the_title(); ?></h2>

    add afterwards <?php the_content(); ?>

  4. cannon303
    Member
    Posted 1 year ago #

    what he said :-p

  5. klippert
    Member
    Posted 1 year ago #

    Thank you oh and do you guys know how to do the next button thing I talked about

  6. Aaron
    Member
    Posted 1 year ago #

    add

    <div class="navigation"><p><?php posts_nav_link(); ?></p></div>

  7. klippert
    Member
    Posted 1 year ago #

    i have this now `<?php
    $posts_to_show = 100; //Max number of articles to display
    $debut = 0; //The first article to be displayed
    ?>
    <?php while(have_posts()) : the_post(); ?>
    <h2><?php the_title(); ?></h2><?php the_content(); ?>
    <ul>
    <?php
    $myposts = get_posts("numberposts=$posts_to_show&offset=$debut");
    foreach($myposts as $post) :
    ?>
    <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>

    <?php endforeach; ?>
    </ul>

    <?php endwhile; ?>`
    where do i add this code and am i just supposed to leave whats inside the parentheses blank

  8. klippert
    Member
    Posted 1 year ago #

    i put <?php the_content(); ?> in and just loaded my page and nothing is different

Topic Closed

This topic has been closed to new replies.

About this Topic