This question is difficult to understand but I think what you want is to run flush_rewrite_rules()
on theme activation. I don’t believe there is a specialized hook for this but both @Rarst and @toscho have posted good methods in another answer. You should be able to easily adapt that code.
Related Posts:
- Get the blog page URL set in Options
- How to set permalink structure via functions.php
- Different ways to display title
- How Do I Programmatically Force Custom Permalinks with My Theme?
- Link won’t show using the_permalink();
- get_query_var() and permalinks
- WordPress custom post type permalink: website.com/post-name/post-id
- Filter categories used with Custom Structure Permalink
- Default Permalink Type to Postname
- How to set a page as homepage in stead of the newspages?
- wordpress 404 not found after rewrtie the author link
- Issue On Displaying Pages with Post Name Permalink
- Issue on Getting Custom post type Thumbnail’s URL
- WordPress page/blog incorporated into static website
- Only the latest post shows up on post page?
- How to remove permalinks links presents in each page of my site?
- If I remove Category base from my URLs, how difficult will rollback be?
- What are the permalinks options for “Category” base and removing it?
- How do I open a post in a custom page in wordpress?
- Does single webpage do not need navigation to create a slug in permalink?
- Getting post URL within custom content template
- Mamp pro permalink issues. Pages keep reverting to index.php
- Permalinks problem with custom theme
- Permalink Setting Changes From Post Name to Default After Changing The Page Name
- Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel
- How to create .pot files with POedit?
- How do I get the theme URL in PHP?
- Why when I submit a form in wordpress it loads a 404 page though URL is correct
- What is the difference between wp_register_sidebar_widget and register_widget?
- How to enqueue script if widget is displayed on page?
- Custom Image section in Customizer
- get_stylesheet_directory() returns wrong URI… localhost/using vhosts
- Any alternate TinyMCE4 themes / subthemes?
- wp_get_attachment_image_attributes not working for me
- How to use Plupload in themes
- add_editor_style not working
- How to handle thumbnails
- WordPress Google Maps in Custom Theme
- In theme development, are there functions which write HTML in a standard fashion to reduce “spaghetti code”?
- Checking if there is an Image inserted – if not don’t display anything
- How can I include a post in a theme?
- Retrieve data using wpdb to use for customizer controls
- Creating directory and file using native wordpress file system
- Don’t understand why theming is so strange and twisted [closed]
- Create self-populating menu and add extra divs to the menu layout
- How to write .htaccess dynamically? [closed]
- Adding wp_enqueue_media(); causes problem
- wp_get_attachment_image_src() width and height boolean
- What is the correct way to do a mobile theme for WordPress?
- How to store functions in… functions.php?
- Is there a need for nonce with Post Metabox?
- get_page_template returning nothing
- Theme Development for WordPress Multisite Installation
- How to make animated intro?
- Replace custom logo with text
- WordPress Website Browser Compatibility issue with IE [closed]
- create category on theme setup
- WordPress get_template_part() function not working
- Recommended method for updating/adding menus when adding new theme
- How to add custom meta box under Gallery Settings in the “Edit Gallery” popup
- Is it possible to make *.js and folders visible in theme-editor
- Customize how a WordPress theme looks like in the Theme Selector
- Images not showing after path specified in header.php
- How to set wp_options in functions.php for removeing the Default Front Page
- Template for landing pages
- Wpautop in wp_editor not working
- Comment status shows ‘closed’ in db, but it shows ‘open’ when i echo it
- html5-reset theme does not show the image [closed]
- WordPress HTML5 Gallery Support – Convert HTML4 -> HTML5
- Contact Form Security
- Where do you add code in custom fuctions so it works on a specific page?
- Customizer Color Control Not Working
- where to start with WordPress theme development [closed]
- Create a Grid/List Toggle in WordPress Archive
- Fixed button and slideshow in template upload per page
- Unable to add widgets to sidebars in custom theme
- Non-standard (new) theme file
- Best Practice for Server Processing
- How do I display a greyed out next_post_link when there is no next post
- What is the difference between Twenty eleven & roots framework?
- Is there any way to store single.php wordpress file into a php variable
- Woocommerce AJAX filters option loading spiner – problem on mobile device
- How to Modify WP_Includes/blocks/latest_posts.php
- Page For Specific Posts
- How can I show a custom WordPress menu anywhere I want on my website?
- Menu is in Reversed order
- How to connect two child themes on different sub domains to the same base theme
- Group several custom global page templates in sub-folder
- Should I detect the device or the page first?
- How does mediaelement.js work in WordPress?
- Theme not uploading showing maximum upload size on live site
- WordPress Theme Developments – Start from another theme
- Access meta box checked value in another file
- Best way to access variables in template markup
- How do I get my theme scripts to load in a custom theme built from Bootstrap
- JQuery Equal Height in Rows Conflicts Only Works without Registering wp_footer();
- Incorrect sidebar showing on WooCommerce Store page [closed]
- How to Create a Multi Purpose Theme?
- customize functionality of share buttons under each blog post [closed]
- WordPress search field won’t get wider