0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; if ( !strpos( $wp_rewrite->get_page_permastruct(), $aaetp_extension ) ) { $wp_rewrite->page_structure = $wp_rewrite->page_structure . $aaetp_extension; $wp_rewrite->flush_rules(); } } } register_activation_hook( __FILE__, 'aaetp_activate' ); function aaetp_deactivate() { global $wp_rewrite; if ( ! current_user_can( 'activate_plugins' ) ) { return; } $plugin = isset( $_REQUEST['plugin'] ) ? $_REQUEST['plugin'] : ''; check_admin_referer( "deactivate-plugin_{$plugin}" ); $aaetp_settings = get_option( 'aaetp_plugin_settings' ); if ( isset ( $aaetp_settings['aaetp_extension'] ) && strlen( trim( $aaetp_settings['aaetp_extension'] ) ) > 0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; $wp_rewrite->page_structure = str_replace( $aaetp_extension, '', $wp_rewrite->page_structure ); $wp_rewrite->flush_rules(); } } register_deactivation_hook( __FILE__, 'aaetp_deactivate' ); /* function aaetp_uninstall() { if ( ! current_user_can( 'activate_plugins' ) ) { return; } check_admin_referer( 'add-any-extension-to-pages' ); if ( __FILE__ != WP_UNINSTALL_PLUGIN ) { return; } exit( var_dump( $_GET ) ); } register_uninstall_hook(__FILE__, 'aaetp_uninstall' ); */ function aaetp_permalink_with_extension() { global $wp_rewrite; $aaetp_settings = get_option( 'aaetp_plugin_settings' ); if ( isset ( $aaetp_settings['aaetp_extension'] ) && strlen( trim( $aaetp_settings['aaetp_extension'] ) ) > 0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; if ( !strpos( $wp_rewrite->get_page_permastruct(), $aaetp_extension ) ) { $wp_rewrite->page_structure = $wp_rewrite->page_structure . $aaetp_extension; } } } add_action( 'init', 'aaetp_permalink_with_extension', -1 ); function aaetp_no_page_trailing_slash($string, $type) { global $wp_rewrite; if ( $wp_rewrite->using_permalinks() && $wp_rewrite->use_trailing_slashes == true && $type == 'page' ){ return untrailingslashit( $string ); } else { return $string; } } add_filter( 'user_trailingslashit', 'aaetp_no_page_trailing_slash', 66, 2 ); function aaetp_plugin_meta( $links, $file ) { // add some links to plugin meta row if ( strpos( $file, 'add-any-extension-to-pages.php' ) !== false ) { $links = array_merge( $links, array( 'Settings' ) ); } return $links; } add_filter( 'plugin_row_meta', 'aaetp_plugin_meta', 10, 2 ); /* * Add a submenu under Tools */ function aaetp_add_pages() { $page = add_submenu_page( 'options-general.php', 'Add Any Extension to Pages', 'Add Any Extension to Pages', 'activate_plugins', 'add-any-extension-to-pages', 'aaetp_options_page' ); add_action( "admin_print_scripts-$page", "aaetp_admin_scripts" ); } add_action( 'admin_menu', 'aaetp_add_pages' ); function aaetp_admin_scripts() { wp_enqueue_style( 'aaetp_styles', plugins_url() . '/add-any-extension-to-pages/css/aaetp.css' ); } function aaetp_options_page() { global $wp_rewrite; if ( isset( $_POST['setup-update'] ) ) { unset( $_POST['setup-update'] ); update_option( 'aaetp_plugin_settings', $_POST ); echo '
'; echo '

Options Updated

'; echo '
'; } ?>

Add Any Extension to Pages

Type in an extension starting with a period (.) and save.

Currently your permalink structure, including any extension you've specified, is permalink_structure; ?>. Make sure the extension below matches the extension on the Permalinks page.

">
  • 0 ) { $aaetp_extension = $aaetp_settings['aaetp_extension']; echo "
    "; echo ""; echo ""; echo "
    "; echo "
    "; } else { echo "
    "; echo ""; echo ""; echo "
    "; echo "
    "; } ?>

Documentation

Instructions

This plugin allows you to specify an extension for pages.

  1. Make sure your permalinks are already set to use an extension.
  2. Type in the extension you would like to use e.g. .html, .htm, .jsp, or any other.
  3. Save. Test. You're done!

Support

Your best bet is to post on the plugin support page.

Please consider supporting me by rating this plugin. Thanks!

Other Plugins

  • Real-Time Find and Replace: Set up find and replace rules that are executed AFTER a page is generated by WordPress, but BEFORE it is sent to a user's browser.
  • Republish Old Posts: Republish old posts automatically by resetting the date to the current date. Puts your evergreen posts back in front of your users.
  • RSS Includes Pages: Modifies RSS feeds so that they include pages and not just posts. My most popular plugin!
  • Enhanced Plugin Admin: At-a-glance info (rating, review count, last update date) on your site's plugin page about the plugins you have installed (both active and inactive).
  • Add Any Extention to Pages: Add any extension of your choosing (e.g. .html, .htm, .jsp, .aspx, .cfm) to WordPress pages.
  • Social Media E-Mail Alerts: Receive e-mail alerts when your site gets traffic from social media sites of your choosing. You can also set up alerts for when certain parameters appear in URLs.