Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
Blog List Page 404 With Custom Post Type Rewriting to Blog Parent
If your CPT rewrite is foobar and and your post (page) slug is foobar then the URL will be example.com/foobar/foobar – if you want a top-level permalink structure you’ll need to implement it.
Internal rewrite rules should all point to index.php. You also need to set the proper query vars so that the main query can successfully run, in this case, to query for your detail page. add_rewrite_rule( ‘detail/([^/]*)/([^/]*)/?$’, ‘index.php?pagename=detail&value1=$matches[1]&value2=$matches[2]’, ‘top’ );
add_rewrite_rule using custom taxonomy and year
Paging not working for hierarchical custom post type
Milo’s advice set Mansur Khan in the right direction: In your rewrite_rules_array filter you can look at $rules and see everything you’d need to duplicate. There are a lot of them- single posts, author archives, date archives, taxonomy archives, post formats, attachments, plus pagination and feeds for all of them. The updated, working code: add_filter( … Read more
I found where problem was – i can’t set other year. All i needed to do is to rename year parameter to something else – for example my_year.
You don’t need to create a folder. And create a file inside your theme with starting content of following one <?php /* Template Name: Mail Page */ // here your mail page content. ?> Now goto backend and pages-> Add New. Title your page and select a Template Mail Page. Now you can write your … Read more
Force WordPress to only match URL in category
I got it function rewrite_profile() { add_rewrite_rule(‘^profile/([0-9]+)/?’, ‘profile/?id=$matches[1]’, ‘bottom’); } add_action(‘init’, ‘rewrite_profile’); I still don’t know if this is the right way.