Skip to content

Fix Shortcode Pagination on Static Front Page#274

Open
brianfreytag wants to merge 1 commit intoWP-for-Church:devfrom
brianfreytag:dev
Open

Fix Shortcode Pagination on Static Front Page#274
brianfreytag wants to merge 1 commit intoWP-for-Church:devfrom
brianfreytag:dev

Conversation

@brianfreytag
Copy link

@brianfreytag brianfreytag commented May 20, 2020

Types of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project. (WPCS)
  • My change requires a change to the documentation.

Brief description of the proposed change:

It appears that between 94e8f82 and ecfdbb7, 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.

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 92fb1e9.

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.

It appears that at some point when the code was updated to an OOP
approach, PR WP-for-Church#46 was reverted and static front page pagination was once
again broken.

This PR remedies this bug. 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, so I check `is_front_page()` before adding the
query strings to `add_args` in `paginate_links()`.
@brianfreytag
Copy link
Author

@nikola3244 Any chance we can get some movement on this?

@brianfreytag
Copy link
Author

Is this project still maintained?

@brianfreytag
Copy link
Author

@nikola3244 Hi. Can we get this merged?

@brianfreytag
Copy link
Author

Anybody?

@brianfreytag
Copy link
Author

Is this going to get merged?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants