URL rewrites and pagination

I must say that I am a complete nooby at WordPress custom URL rewrites. I have searched for past many days to find a clear explanation of how to determine and write correct pattern for URL rewrites. I have a custom page template that uses query var passed to it, e.g. http://example.com/pagename?user=username. In this “pagename” refers to the custom page template and “user” refers to the custom query var. I need this to be represented using the URL http://example.com/pagename/username.

Custom post type, no need for single view, plus want permalink rewrites that include hash in URI

We are using CPT’s to manage a frequently asked questions page on a site, where the question is the post title and the answer is the post content. There is a main page for the FAQs that shows all posts (FAQ archive page). With this structure we really have no need for the single view for any FAQ and in fact would like to omit it from the site structure. To address permalinks we’d like to set them to be something like example.com/faq/#uniqueIdentifier, thinking that we’ll use the #uniqueIdentifier to match a div on the archive page containing the answer and call attention to it in some fashion. The uniqueIdentifier could be post ID, faq question title, data from a meta box, or something else.

add_rewrite_rule() not playing nice with child pages

function my_add_rewrite_rules() { add_rewrite_rule('testing/([^/]+)?$', 'index.php?pagename=testing&event_slug=$matches[1]', 'top' ); } add_action( 'init', 'my_add_rewrite_rules' ); function add_query_vars( $query_vars ) { $query_vars[] = 'event_slug'; return $query_vars; } add_filter( 'query_vars', 'add_query_vars' ); /testing/foo – Works, shows foo If I have testing set to no parent, the rewrite works and everything is good to go. If I set testing to a … Read more