Pagination in ClassicPress theme

Hi,

Because I don’t have a Github account I post here…
If there’s no previous post, the pagination is displayed wrong.
Check the alignment of the next post link in screenshot.

Adding flex:1; will solve this:

.nav-previous,
.nav-next {
	flex: 1;
}

Guido

Try a conditional call for the link function. If not there then it will not show.

            <ul class="list-inline">
            
            <?php //only show if there are more posts
            if( get_next_posts_link() ) { ?>
            
                <li class="btn btn-paging notblank previous">
            
                    <?php next_posts_link("&laquo; "
                          . __('Older posts', "appealing")); ?></li>
            <?php } ?>
            
                <li></li>
            
                <?php //only show if more pagination of posts
                if( get_previous_posts_link()) { ?>
            
                <li></li>
                <li class="btn btn-paging notblank next">
            
                    <?php previous_posts_link(
                          __('Newer posts', "appealing") . " &raquo;"); ?></li>
                <?php } ?>
            
            </ul>
        </nav>```

Hi,

Thanks. Because I don’t have Github I was hoping someone else is picking this up.

By the way, there should be navigation in this case. It’s about the alignment.

Guido

Added a PR at Github.

Guido

2 Likes

I will pick this up, if you don’t mind, as I want to fix other issues, too. We can both work on it.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.