Support

Account

Home Forums General Issues Relationship urls between custom pages

Solving

Relationship urls between custom pages

  • hi,

    I’ve created 2 custom posts.And I’m trying to make the urls right.

    One custom post type has just products with some ACF fields.

    The other post type has the lists of products. With a ACF relational picker from the other custom post type “products”. The user picks witch products are shown.

    No problems getting data out to the screen correctly.

    But the URL should be like this:

    This page contaings the list of all productlists with links to a single list. Works fine.
    example.com/productlist/

    This page contains the list of all products picked in that productlist, with links to the single products. Works fine.
    example.com/productlist/title-of-list/

    And finally when clicking in one link in the “title-of-list” above, it should result in this:
    example.com/productlist/some-title-of-list/the-name-of-the-product

    But so far I’ve managed to get this link:
    example.com/product/the-name-of-the-product

    or similar for example this also missing the “productlisttitle”, so the breadcrumbs is not right.
    example.com/productlist/product/the-name-of-the-product

    Functions.php

    productspage:
    This is achieved by using “has archive”
    ‘has_archive’ => ‘productlist’,
    ‘rewrite’ => array(‘slug’=>’productlist/product’, ‘with_front’=> false),

    this should be somehow wich a rewrite_tag or something:
    ‘rewrite’ => array(‘slug’=>’productlist/productlisttitle/product’, ‘with_front’=> false),

    productslistpage:
    ‘rewrite’ => array(‘slug’=>’productlist’,’with_front’=> false),

    No how do I fix this urls structure?
    I’ve tried alot of things 🙂

  • Hi @kreative

    I’m afraid the URL structure of a custom post type is handled by WordPress, not ACF. In this case, kindly visit WordPress community as they know better regarding this issue.

    Thanks 🙂

  • This reply has been marked as private.
Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Relationship urls between custom pages’ is closed to new replies.