Open brianfreytag opened 4 years ago
It appears that between https://github.com/WP-for-Church/Sermon-Manager/commit/94e8f826387a5ae134e29b78b9fb3797b4e500e4 and https://github.com/WP-for-Church/Sermon-Manager/commit/ecfdbb7b772aa6801cbb1394dfd77ebc904a4854, PR #46 was reverted and static front page pagination was once again broken. This PR remedies this bug. Further, it seems like if you are on the first page, and the query parameter is empty, the Next button doesn't appear, so this will also default the value to 1 if neither paged nor page is defined.
paged
page
Additionally, on static front pages, adding query strings to the end of the URL (https://yoursite.com/page/2/?page_id=873&p=873) will break the pagination functionality. It appears that these arguments are added by default on static front pages, most likely because the static front page suppresses the page information. In this PR, I check is_front_page() before adding the query strings to add_args in paginate_links(). This regression was added in https://github.com/WP-for-Church/Sermon-Manager/commit/92fb1e963056e7fa39a01ce19f4ee782f1aefc99.
is_front_page()
add_args
paginate_links()
I'm not sure why the main sermons page utilizes the standard Wordpress DOM for pagination but the shortcode does not. It requires dual-styling. This is outside of the scope of this PR, so it's something that might be discussed in the future.
@nikola3244 Any chance we can get some movement on this?
Is this project still maintained?
@nikola3244 Hi. Can we get this merged?
Anybody?
Is this going to get merged?
Types of changes:
Checklist:
Brief description of the proposed change:
It appears that between https://github.com/WP-for-Church/Sermon-Manager/commit/94e8f826387a5ae134e29b78b9fb3797b4e500e4 and https://github.com/WP-for-Church/Sermon-Manager/commit/ecfdbb7b772aa6801cbb1394dfd77ebc904a4854, PR #46 was reverted and static front page pagination was once again broken. This PR remedies this bug. Further, it seems like if you are on the first page, and the query parameter is empty, the Next button doesn't appear, so this will also default the value to 1 if neither
paged
norpage
is defined.Additionally, on static front pages, adding query strings to the end of the URL (https://yoursite.com/page/2/?page_id=873&p=873) will break the pagination functionality. It appears that these arguments are added by default on static front pages, most likely because the static front page suppresses the page information. In this PR, I check
is_front_page()
before adding the query strings toadd_args
inpaginate_links()
. This regression was added in https://github.com/WP-for-Church/Sermon-Manager/commit/92fb1e963056e7fa39a01ce19f4ee782f1aefc99.Any other info:
I'm not sure why the main sermons page utilizes the standard Wordpress DOM for pagination but the shortcode does not. It requires dual-styling. This is outside of the scope of this PR, so it's something that might be discussed in the future.