Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The pagination functions called by your template probably have filters you can hook into and rearrange or regenerate anew the proper URL structure. Identify what functions are used, then locate the source code in the Code Reference. If, near the end of the function declaration, there is a call to apply_filters(), you’re in luck. Hook that filter and rearrange the passed data. More on filter hooks are in the Plugin Handbook.

    If there is no filter for the outer function, sometimes sub-functions have filters that can be used. Follow the “Uses” links below the source code to check sub-function code. If that does not help, you can copy the function code, renaming the function and altering what it does. Then on your template, call your custom function instead of the default.

    Some themes have custom navigation functions themselves. If so, find the function declaration in the theme code. If the function is declared as “pluggable”, evidenced by the declaration being within a if ( ! function_exists( ‘function_name’ )) : ; construct, you can simply redefine the same function within your own plugin or child theme. No new name required.

Viewing 1 replies (of 1 total)
  • The topic ‘Using page_link with pagination causing broken permalinks?’ is closed to new replies.