WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Main page 1 post. Forward / Next no worky. (4 posts)

  1. sanchit
    Member
    Posted 7 years ago #

    Alright, so

    http://66.7.201.40/~cujpybvo/wordpress/Comic/ is using the index.php file in the current theme.

    http://66.7.201.40/~cujpybvo/wordpress/Comic/index.php/comic/
    is using the comic_main.php file.

    I want to be the main page to be the same as http://66.7.201.40/~cujpybvo/wordpress/Comic/index.php/comic/
    as the forward / next thing works over here and the URL would look nice.

    These files are uploaded here.
    http://66.7.201.40/~cujpybvo/index.zip

    Hopefully this info is enough, reading the php files should clarify all your questions. I hope someone here can help me fix this issue.

    Belor are the php files in text for those who don't want to open the zip file. Thanks!
    ---

    <?php
    /* Template Name: Comic Main
    */
    ?>
    <?php get_header(); ?>
    <?php $my_query = new WP_Query('category_name=comic&showposts=1'); ?>
    <div id="comic">
     <?php while ($my_query->have_posts()) : $my_query->the_post();
           $do_not_duplicate = $post->ID; ?>
     <h3 align="center" class="etitle" rel="bookmark" id="post-<?php the_ID(); ?>"><?php the_title(); ?></h3>
      <div class="entry_comic <?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
       <div class="ebody">
        <?php the_content(__('Read more'));?>
        <?php edit_post_link(__('<strong>Edit</strong>'));?>
       </div>
    <!-- <?php trackback_rdf(); ?> -->
      </div>
      <?php //comments_template(); // Get wp-comments.php template ?>
    <p>
    <?php
    $wp_query->is_single = true;
    previous_post('%','&laquo; Previous', 'no');
    $wp_query->is_single = false;
    ?>
    </p>
    <?php endwhile;?>
    </div>
    <!-- <?php //get_sidebar(); ?> -->
    <!-- The main column ends  -->
    <?php get_footer(); ?>
    <?php
    /* Template Name: Main Index Page
    */
    ?>
    <?php
    get_header();
    ?>
    <?php //query_posts('category_name=comic&showposts=1'); ?>
    <div id="comic">
      <?php while (have_posts()) : the_post(); ?>
    <h3 align="center" class="etitle" rel="bookmark" id="post-<?php the_ID(); ?>"><?php the_title(); ?></h3>
      <div class="entry_comic <?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>">
        <div class="ebody">
          <?php the_content(__('Read more'));?>
    <?php edit_post_link(__('<strong>Edit</strong>'));?>
        </div>
        <!-- <?php trackback_rdf(); ?> -->
      </div>
      <?php //comments_template(); // Get wp-comments.php template ?>
    <p>
    <?php
    $wp_query->is_single = true;
    previous_post('%','&laquo; Previous', 'no');
    $wp_query->is_single = false;
    ?>&nbsp;&nbsp;&nbsp;&nbsp;
    <?php
    $wp_query->is_single = true;
    next_post('%','Next &raquo;', 'no');
    $wp_query->is_single = false;
    ?>
    </p>
      <?php endwhile; ?>
    </div>
    <!-- <?php //get_sidebar(); ?> -->
    <!-- The main column ends  -->
    <?php get_footer(); ?>
  2. sanchit
    Member
    Posted 7 years ago #

    I fixed it. Options->Reading->FrontPage(COMIC)
    I left the posts page blank.. dunno what it'll do but i think my problem is fixed.

  3. animedirect
    Member
    Posted 6 years ago #

    Is there just some simple way! to have 1 single post on your home page instead of 10?

  4. xanuex
    Member
    Posted 6 years ago #

    You can change this in the admin under
    Options -> Reading (of 2.5 Settings -> Reading) -> [Blog pages show at most]

    or if you just want to show one post on the first page and 10 on the second you can use this code:

    <?php
    // Show only one post on the first page
    	if(is_home() && !$paged) {
        query_posts('showposts=1');
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic