Skip to main content
Had suggested this was related to terms_link, it isn't.
Source Link
davemackey
  • 315
  • 2
  • 18

Using term_link How to paginate with pagination results in brokenan query var appended to permalink?

I have a function that applies a query_var to all links in a page if the query_var exists for the current page.

So if I change

https://liquidchurch.com/messages/

to

https://liquidchurch.com/messages/messages-app-view/

then all the links for terms on the page are updated to look something like this:

https://liquidchurch.com/sermon-series/divine-direction/message-app-view/

The problem is with the pagination at the bottom of the page. If you look at the /messages page while messages-app-view is appended you'll see that the permalink to the next page looks like:

https://liquidchurch.com/messages/messages-app-view/page/2/

Problem is that this will return a 404. Ideally I'd like for the URL to be:

https://liquidchurch.com/messages/page/2/messages-app-view/

Alternatively, I suppose a regex would work that checks if /page/x/ is listed after messages-app-view.

Thoughts on how I should accomplish this? Thanks!

Using term_link with pagination results in broken permalink

I have a function that applies a query_var to all links in a page if the query_var exists for the current page.

So if I change

https://liquidchurch.com/messages/

to

https://liquidchurch.com/messages/messages-app-view/

then all the links for terms on the page are updated to look something like this:

https://liquidchurch.com/sermon-series/divine-direction/message-app-view/

The problem is with the pagination at the bottom of the page. If you look at while messages-app-view is appended you'll see that the permalink to the next page looks like:

https://liquidchurch.com/messages/messages-app-view/page/2/

Problem is that this will return a 404. Ideally I'd like for the URL to be:

https://liquidchurch.com/messages/page/2/messages-app-view/

Alternatively, I suppose a regex would work that checks if /page/x/ is listed after messages-app-view.

Thoughts on how I should accomplish this? Thanks!

How to paginate with an query var appended to permalink?

I have a function that applies a query_var to all links in a page if the query_var exists for the current page.

So if I change

https://liquidchurch.com/messages/

to

https://liquidchurch.com/messages/messages-app-view/

then all the links on the page are updated to look something like this:

https://liquidchurch.com/sermon-series/divine-direction/message-app-view/

The problem is with the pagination at the bottom of the page. If you look at the /messages page while messages-app-view is appended you'll see that the permalink to the next page looks like:

https://liquidchurch.com/messages/messages-app-view/page/2/

Problem is that this will return a 404. Ideally I'd like for the URL to be:

https://liquidchurch.com/messages/page/2/messages-app-view/

Alternatively, I suppose a regex would work that checks if /page/x/ is listed after messages-app-view.

Thoughts on how I should accomplish this? Thanks!

Post Undeleted by davemackey
Post Deleted by davemackey
Source Link
davemackey
  • 315
  • 2
  • 18

Using term_link with pagination results in broken permalink

I have a function that applies a query_var to all links in a page if the query_var exists for the current page.

So if I change

https://liquidchurch.com/messages/

to

https://liquidchurch.com/messages/messages-app-view/

then all the links for terms on the page are updated to look something like this:

https://liquidchurch.com/sermon-series/divine-direction/message-app-view/

The problem is with the pagination at the bottom of the page. If you look at while messages-app-view is appended you'll see that the permalink to the next page looks like:

https://liquidchurch.com/messages/messages-app-view/page/2/

Problem is that this will return a 404. Ideally I'd like for the URL to be:

https://liquidchurch.com/messages/page/2/messages-app-view/

Alternatively, I suppose a regex would work that checks if /page/x/ is listed after messages-app-view.

Thoughts on how I should accomplish this? Thanks!