Hello, I would like your help to solve the following problem that I am having, the code below below filters Wordpress items by letter, however I am not able to integrate the paging function into this script, I would like your help to be able to improve the script so that it stays with numeric pagination and paging arrows.
<?php
$posts_per_row = -1;
$posts_per_page = -1;
$curr_letter = $_GET["letra"];
?>
<div>
<div class="alphanav">
<a href="<?php bloginfo('url'); ?>/lista/?letra=A">A</a>
<a href="<?php bloginfo('url'); ?>/lista/?letra=B">B</a>
<a href="<?php bloginfo('url'); ?>/lista/?letra=C">C</a>
</div>
<div>
<div id="a-z">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : +1;
$args = array (
'posts_per_page' => $posts_per_page,
'post_type' => 'blog',
'orderby' => 'title',
'order' => 'ASC',
);
query_posts($args);
if ( have_posts() ) {
while ( have_posts() ) {
the_post();
If ($curr_letter == true) { $first_letter = strtoupper(substr(apply_filters('the_title',$post->post_title),0,1));
if ($first_letter == $curr_letter) { ?>
<div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div>
<?php } else { ?>
<? } ?>
<?php } else { ?><div class="title-cell"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></div> <?} } ?>
<?php } else {
echo "<h2>Desculpe o conteudo não existe</h2>";
}
?>
</div><!-- End id='a-z' -->
</div>
</div>