Support » Plugin: Alphabetic Pagination » ABD links not showing correct letters

  • Resolved LucyTech

    (@lucytech)


    I have a page with the code:
    `[ap_pagination]

    [list_posts post_type=”artist” orderby=”title” order=”ASC” style=”grid4″ limit=”16″]

    The ABD links are showing but are not doing anything.

    I would only like to display posts of a specific post type. I couldn’t see an option for this on the setup page.
    I would like to show 16 posts per page for each letter with a next/pre button so users can go to the next page within each letter.
    The links in the ABC are just reloading the page but not showing results for that letter.
    How do I get this to work?
    Thanks

    https://wordpress.org/plugins/alphabetic-pagination/

Viewing 8 replies - 1 through 8 (of 8 total)
  • I have written my own query to show a custom post type. I would like it be be listed by ABC, when you click on each letter show those letter results. How do I adjust my query to use your plugin?
    My query is:
    `function alphabetical_artists(){
    // only run function if is artist archive page
    if(is_archive (‘artist’)){
    global $wpdb;

    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    $args = array(
    ‘posts_per_archive_page’ => 16,
    ‘paged’ => $paged,
    ‘offset’ => 0,
    ‘category’ => ”,
    ‘orderby’ => ‘title’ ,
    ‘order’ => ‘ASC’,
    ‘post_type’ => ‘artist’,
    ‘post_status’ => ‘publish’,
    ‘suppress_filters’ => true
    );
    //NOW YOU WILL GET RESULTS BY THIS METHOD

    $the_query = new WP_Query( $args );

    // The Loop
    if ( $the_query->have_posts() ) {
    echo ‘

      ‘;
      while ( $the_query->have_posts() ) {
      $the_query->the_post();?>

  • “><?php the_title(); ?>
  • <?php
    }
    echo ‘
    ‘;
    } else {// no posts found}

    }

    }
    add_action(‘themify_content_start’, ‘alphabetical_artists’);

Plugin Author Fahad Mahmood

(@fahadmahmood)

Hi,

You will find a function “ap_where()” in functions.php. Try to use it with WP_Query and reset the post data. It should work, if still not working, just let me know.

Thanks,
Fahad

I can see the ap_where() but I’m not sure what you mean ‘Try to use it with WP_Query and reset the post data
I’ve posted my code above, can you show me how to add it to the query.
Thanks.
Also what settings should I set in the UI?
Implementation – custom?
Display on all lists – yes/no?
Dom Position?

Thanks

Plugin Author Fahad Mahmood

(@fahadmahmood)

Hi,

If you go for “Auto” settings and Display on All lists “yes”. DOM position i am not sure in your case but you can set any div “id” like “#content” or “#primary” in wordpress templates so it will work fine. For WP_Query i will say that there are two ways to write the query. One is that you showed in your post and the other one is custom (plain sql query). In that way you will be able to use ap_where() function’s code.

Thanks,
Fahad

I changed my code to

add_filter( 'posts_where', 'ap_where_clause', 10, 2 );
  $the_query = new WP_Query($args);
  return $the_query;
	// $the_query = new WP_Query( $args );

	  // The Loop
	  if ( $the_query->have_posts() ) {
	        echo '<ul>';
		while ( $the_query->have_posts() ) {
			$the_query->the_post();?>
			<li>
			<a href="<?php the_permalink(); ?>"><?php the_title();?></a><br />
			<?php $post_id = get_the_ID(); echo  get_post_meta($post_id, 'image', true); ?>
		</li>
		<?php wp_reset_postdata(); ?>

but now nothing is showing. What am I doing wrong?

Plugin Author Fahad Mahmood

(@fahadmahmood)

Hi Lucy,

If your problem is not yet been fixed, let me know. I am going to work on this issue so i will implement it on your site first.

Thanks,
Fahad

No, I haven’t managed to fix the problem yet

Plugin Author Fahad Mahmood

(@fahadmahmood)

Hi,

Can you send me the wp-admin credentials for testing purpose through my blog? It will help me to fix the issue in actual environment.

Thanks

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘ABD links not showing correct letters’ is closed to new replies.