• Resolved sanchit

    (@sanchit)


    Alright, so

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

    https://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 https://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.
    https://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(); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sanchit

    (@sanchit)

    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.

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

    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');
    }
    ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Main page 1 post. Forward / Next no worky.’ is closed to new replies.