Skip to main content
Clarify that I am getting the same results even though trying two different filters.
Source Link
davemackey
  • 315
  • 2
  • 18

I previously wrote a question about rewriting a URL based on an originating URL and Milo provided me with a working answer for pages/posts. But now I am trying to do a taxonomy rewrite and the same functionality seems to break things.

Here is my code:

function lqd_series_link( $term_id, $taxonomy ) {
  if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
    return $taxonomy; // I've also tried $link
  }
  return $taxonomy;
}
add_filter( 'term_link', 'lqd_series_link' );

What is strangest is what this results in. So if I do the code as Milo instructed on the question linked above I end up with a URL for pages like:

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

But when I use the above code I end up with something likethe same exact thing:

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

Thoughts?

I previously wrote a question about rewriting a URL based on an originating URL and Milo provided me with a working answer for pages/posts. But now I am trying to do a taxonomy rewrite and the same functionality seems to break things.

Here is my code:

function lqd_series_link( $term_id, $taxonomy ) {
  if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
    return $taxonomy; // I've also tried $link
  }
  return $taxonomy;
}
add_filter( 'term_link', 'lqd_series_link' );

What is strangest is what this results in. So if I do the code as Milo instructed on the question linked above I end up with a URL for pages like:

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

But when I use the above code I end up with something like:

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

Thoughts?

I previously wrote a question about rewriting a URL based on an originating URL and Milo provided me with a working answer for pages/posts. But now I am trying to do a taxonomy rewrite and the same functionality seems to break things.

Here is my code:

function lqd_series_link( $term_id, $taxonomy ) {
  if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
    return $taxonomy; // I've also tried $link
  }
  return $taxonomy;
}
add_filter( 'term_link', 'lqd_series_link' );

What is strangest is what this results in. So if I do the code as Milo instructed on the question linked above I end up with a URL for pages like:

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

But when I use the above code I end up with the same exact thing:

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

Thoughts?

Source Link
davemackey
  • 315
  • 2
  • 18

How Can I Change a Taxonomy URL Based On The Originating URL?

I previously wrote a question about rewriting a URL based on an originating URL and Milo provided me with a working answer for pages/posts. But now I am trying to do a taxonomy rewrite and the same functionality seems to break things.

Here is my code:

function lqd_series_link( $term_id, $taxonomy ) {
  if ( $taxonomy == 'gc-sermon-series' && isset( $wp_query->query_vars['app-view'] ) ) {
    return $taxonomy; // I've also tried $link
  }
  return $taxonomy;
}
add_filter( 'term_link', 'lqd_series_link' );

What is strangest is what this results in. So if I do the code as Milo instructed on the question linked above I end up with a URL for pages like:

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

But when I use the above code I end up with something like:

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

Thoughts?