• Resolved dubbinz

    (@dubbinz)


    I found this on the internet and it does everything I want apart from the pagination. I know very little about php so I wondered if some kind soul can help me out. I want to remove all pagination from it completely and keep the rest. Here is the code.

    <?php
             $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
             $args = array (
                'posts_per_page' => $posts_per_page,
                'post_type' => 'post',
    	    'category_name' => 'anime-reviews',
                'orderby' => 'title',
                'order' => 'ASC',
                'paged' => $paged
             );
             query_posts($args);
             if ( have_posts() ) {
                $in_this_row = 0;
                while ( have_posts() ) {
                   the_post();
                   $first_letter = strtoupper(substr(apply_filters('the_title',$post->post_title),0,1));
                   if ($first_letter != $curr_letter) {
                      if (++$post_count > 1) {
                         end_prev_letter();
                      }
                      start_new_letter($first_letter);
                      $curr_letter = $first_letter;
                   }
                   if (++$in_this_row > $posts_per_row) {
                      end_prev_row();
                      start_new_row();
                      ++$in_this_row;  // Account for this first post
                   } ?>
                   <div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
                <?php }
                end_prev_letter();
                ?>
                <div class="navigation">
                   <div class="alignleft"><?php next_posts_link('&laquo; Higher Letters') ?></div>
                   <div class="alignright"><?php previous_posts_link('Lower Letters &raquo;') ?></div>
                </div>
             <?php } else {
                echo "<h2>Sorry, no posts were found!</h2>";
             }
             ?>

    And here is the function

    function end_prev_letter() {
       end_prev_row();
       echo "</div><!-- End of letter-group -->\n";
       echo "<div class='clear'></div>\n";
    }
    function start_new_letter($letter) {
       echo "<div class='letter-group'>\n";
       echo "\t<div class='letter-cell'>$letter</div>\n";
       start_new_row($letter);
    }
    function end_prev_row() {
       echo "\t</div><!-- End row-cells -->\n";
    }
    function start_new_row() {
       global $in_this_row;
       $in_this_row = 0;
       echo "\t<div class='row-cells'>\n";
    }

    As I said I need to change this to show the full list of posts without the pagination and keep everything else. Thanks in advance for anyone kind enough to help me out.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Need help editing some php I found’ is closed to new replies.