Site icon Hip-Hop Website Design and Development

Rewrite URL – insert customized variables as a listing path

I am attempting to re-write permalink construction with my very own customized url in WordPress for a Divi Theme “mission”

I’ve already modified the “Divi slug” from “mission” to “prodotti” so at present, the URL seems like this:

http://www.instance.com/prodotti/%postname%/

with my customized perform

perform custom_post_name() {
    return array(
        'feeds' => true,
        'slug' => 'prodotti',
        'with_front' => false,
    );
}
add_filter('et_project_posttype_rewrite_args', 'custom_post_name');

I wish to add to those urls a variable, that reside for every submit in post_metadata, with a view to construct a url like:

http://www.instance.com/prodotti/<mypostoptionvalue>/%postname%/

ex:

http://www.instance.com/prodotti/AEX1102/%postname%/
http://www.instance.com/prodotti/AEX1103/%postname%/
http://www.instance.com/prodotti/AEX1104/%postname%/

Is there a option to obtain this type of habits?

I’ve achieved many take a look at utilizing, {$permastruct}_rewrite_rules, page_rewrite_rules, post_rewrite_rules and extra ranging from: https://codex.wordpress.org/Class_Reference/WP_Rewrite with out outcomes.