## Dynamic URL with rewrite rule not working

Question
I'm trying to update my link from this: https://dev.brunchwork.com/next-event/?eb_event_id=106098978902 To this: https://dev.brunchwork.com/next-event/[guest_name_here]/[event_id_here] Following this discussion, I was able to come up with this code: In my functions.php: /*rewrite rule*/ function custom_rewrite_rule() { add_rewrite_rule('^next-event/([^/]*)/([^/]*)/?','index.php?page_id=69&guest_name=$matches[1]&event_id=$matches[2]','top'); } add_action('init', 'custom_rewrite_rule', 10, ...
0
5 days 0 Answers 18 views

## How to use endpoint, but remove/rewrite endpoint base?

Question
I've been messing around with rewrites and query_var to generate some listings, for example: ~/my-page/?my_var=1 ~/my-page/?my_var=2 ~/my-page/?my_var=3 After perusing StackExchange and the interwebs a bit, it seems that the overwhelming consensus is that add_rewrite_endpoint is the way to go. As such, I've ...
0
5 days 0 Answers 9 views

Question
Using this code here: add_filter( 'rewrite_rules_array', function( $rules ) {$new_rules = array( 'services/([^/]*?)/page/([0-9]{1,})/?$' => 'index.php?product_cat=$matches[1]&paged=$matches[2]', 'services/([^/]*?)/?$' => 'index.php?product_cat=$matches[1]', ... 0 1 week 0 Answers 14 views ## How to solve page not found problem with pagination in wordpress? Question I am new in wordpress and i add the rewrite rule for search in twenty-twenty theme, but now the problem is when i go to second page using pagination, it return 404 error. Here is the rewrite rule function add_rewrite_rules($aRules) { ...
0
2 weeks 0 Answers 22 views

## Passing variables in the permalink structure on a custom post type

Question
I have a structure like this for my custom post types: domain.com/member/member-name/book/book-name Basically, I have a custom post type of member, and the member-name is the post. What I want to do is pass a variable called books, but I can't get ...
0
2 weeks 0 Answers 27 views

## rewrite the url keeping the previous one

Question
I would like to understand if it is possible, through add_rewrite_rule, to do this: a user types: https://example.com/username the user sees the page: https://example.com/author/username the url remains: https://example.com/username Thanks
0
2 weeks 0 Answers 25 views

## How to make mydomain.com/[post_typeA]/[post_nameB]/[post_nameA] not 404: custom post types rewrite rules. ([PostTypeA]/[ParentPage]/[ChildPage])

Question
I scoured this forum and a lot of others but I have not found the answer and starting to doubt whether it's even possible.. I'm trying to make a site with week and day posts, a day post is called ...
0
2 weeks 0 Answers 23 views

## Best way to flush_rewrite_rules for custom post type, in a mu-plugins plugin?

Question
I am writing a plugin that instantiates a custom post type (among other things). It is a multisite plugin and lives in the directory mu-plugins. What is the best practice for handling flush_rewrite_rules() in this situation? For a 'normal' ...
0
2 weeks 0 Answers 23 views

## Looking to Have Custom Permalink For One Post Category, Removing The Base

Question
I have custom permalinks setup with blogs/%postname%/ for the Press category I need it to just be /%postname%/ I've tried a few post re-writes of permalinks but I couldn't find one that removed the base than replace. Looking to do ...
0
2 weeks 0 Answers 32 views

## Rewrite Rule for Post Meta

Question
I would like to create an endpoint for a custom field. For example, I already have a custom 'competition' post type for which rewriting is working great and resolving at website.com/competitions/my-competition. Within that competition I have award categories created using ...
0
3 weeks 0 Answers 32 views