• Resolved Ajay Maurya

    (@ajmaurya)


    Hey, thanks for the great plugin,

    I have a specific use-case, I want to enable Custom Permalinks only on pages which has specific page template selected.

    I couldn’t find anything on the support related to this.

    Any help on this would be appreciated.

Viewing 1 replies (of 1 total)
  • Plugin Author Sami Ahmed Siddiqui

    (@sasiddiqui)

    Hi @ajmaurya

    Sorry for the delay in my response. You can use custom_permalinks_exclude_post_type filter to apply your use case.

    function yasglobal_exclude_post_types( $post_type ) {
      if ( $post_type == 'custompost' ) {
        return '__true';
      }
      return '__false';
    }
    add_filter( 'custom_permalinks_exclude_post_type', 'yasglobal_exclude_post_types');
    

    As in the above example, I am only running this plugin on the custompost. You can change the code and check the template in it and return the value accordingly.

    NOTE: This filter does not work on the permalink which has been created previously.

    Sami

Viewing 1 replies (of 1 total)
  • The topic ‘Enable “Custom Permalinks” only for specific page templates’ is closed to new replies.