Custom Post Fields at the beginning of a Custom Permalink

Is there any way to have a permalink begin with a custom post field? For example, the follow works:

  • $wp_rewrite->add_permastruct(‘solicitors’, ‘/anything/%custom_field%/%custom_field_2%’, false);

But this doesn’t:

Read More
  • $wp_rewrite->add_permastruct(‘solicitors’, ‘/%custom_field%/%custom_field_2%/’, false);

It seems that every page aside from city pages get redirected to the homepage when the custom field placeholder is placed first. When a manual text item (such as ‘anything) is placed first, it works, but that is not what our structure needs to be. Any ideas?

Related posts