Skip Navigation

[Closed] Wrong permalink base for child posts

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 16 replies, has 3 voices.

Last updated by Ghennadi 7 years, 10 months ago.

Assigned support staff: Ghennadi.


I have a custom post type "artists" whose posts are assigned as child posts to several pages (e.g. "photography", "painting") via WP Types.
Shouldn't the permalink now look like /%page-name%/%artist-name% (e.g. /painting/picasso)?
When I go to this site I will always be redirected to /artists/%artist-name%


Dear Lukas,

Please attach here an image from the this custom post type settings. Would be nice a full screen image.

Bildschirmfoto 2013-12-03 um 20.54.33.png
Bildschirmfoto 2013-12-03 um 20.54.15.png

I hope work with these even though they are in German. I don't know how to set English as language.


Additional Question referring to this topic:

My Custom Post Types's Data is supposed to be split outputted on virtual subpages (like: /%page_name%/%artist_name%/%subpage_name%
So I got for example two textareas "press" and "vita"; in my single-artist.php there is a switch/case which compares the "subpage_name" of the query to "press" and "vita" and outputs the appropriate data.
Which query variables do I need to use in my rewrite_rules? It should be something like: index.php?artist=xxx&subpage_name=xxx&wptypes_parent_post_slug=YYY
So I can use the variable (wptypes_parent_post_slug or whatever) in my rewrite rules.


I’ll send you a private email right now asking you for some private information that will help me debug this issue for you. Please check your email in a couple of minutes, and if you don’t get it, let me know so I can send it again.


Dear Adriano,
could you find any solution to this problem yet?


Dear lukasB,

With Types plugin you can't modify URL structure.
You can mix custom post type taxonomy and this plugin

Also, you can read some info about how to create custom URL structure at hidden link

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.


Dear Ghennadi,

in a default WordPress Environment you can create pages and you can create child pages to these pages. The permalink to a child page would be for example /parent-page/child-page. This is not possible with custom post types.
The plugin Types introduces this feature also to custom post types and so it also has to modify the rewrite rules to work like /parent-page/child-custom-post-type. Actually, this redirects me to /name-of-custom-post-type/child-custom-post-type. So declaring the parent as parent have not brought me any advantage.

So it is necessary to modify the rewrite rules. It should be something like:


You see, for the rewrite rules I need to know the real name of the variable I called in the example "wpt_parent". Then I could visit:
and it should output the artist's page. If I just visited index.php?wpt_parent=photography only those posts should be output (like archive.php) which are declared as child posts of the page photography by WP Types.

(For better understanding I am using "Sam Sample" as the desired child-custom-post-type; custom post type is "artist" and parent page is "photography")

Do you understand my explanations?


Is it correct, that "_wpcf_belongs_artist_id" is a custom field key?
So one approach would be to add this to the query like:

function wpa_filter_home_query( $query ){
    if( $query->is_main_query()
    && isset( $_GET['_wpcf_belongs_artist_id'] ) ) {
        $meta_query = array(
                'key' => '_wpcf_belongs_artist_id',
                'value' => array( $_GET['_wpcf_belongs_artist_id'] )
        $query->set( 'meta_query', $meta_query );
add_action( 'pre_get_posts', 'wpa_filter_home_query' );

Doing this, my aim is still to get the correct post with "index.php?_wpcf_belongs_artist_id=24&artist=sam-sample" (24 is a sample id for the parent page) as a first step. Once this is working I can think about rewrite rules.


Dear lukasB,

Yes, if you can get send _wpcf_belongs_artist_id variable it's will work.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.


But in fact, this does not work for me.
And shouldn't this work by default?


Dear lukasB,

First of all, you must add rewrite rule ( more info at: ), otherwise wordpress will show empty page or 404 error page.

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.


Shouldn't work this by default?

This is what I tried:

add_action('init', 'rewrite_rules');
function rewrite_rules(){

  /* I tried with and without add_rewrite_tag */
  add_rewrite_tag('%_wpcf_belongs_artist_id%', '([^&]+)');


It doesn't work. How should it work? This:
redirects me to:
and outputs that no posts were found.
doesn't redirect but only outputs that no posts were found.

If I deactivate my function wpa_filter_home_query() explained above, this:
redirects me to:
with the correct output of the single artist post.
just outputs my front page.
The only more or less working example is with the same settings:
/photography/sam-sample/?artist=sam-sample&_wpcf_belongs_artist_id=24 and:
These DON'T redirect me to /artist/sam-sample/… but output the correct single artist post.

btw my whole site seem to load very slow since I am working on that problem.

Please give me specific answers. I buyed plugins from you and you offer support for them. This is an issue which should work by default but it doesn't. I also gave approaches to the solution and you just repeated them.


There must be a rewrite rule specified somewhere, because this:
redirects to this:

But I can not find it. I don't know if this is specified in WordPress's default code or in your plugin. I suppose in your plugin.


Dear lukasB,

Type by default not allow this URL structure. We understand this feature request, but we cannot implement it because our analysis shows that it might cause serious compatibility problems with newer WordPress versions, themes and other plugins.
You can ask help from our certified partners at

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

The topic ‘[Closed] Wrong permalink base for child posts’ is closed to new replies.