Home Forums General Issues Relationship: only use childpage of a page


Relationship: only use childpage of a page

  • Hey there,

    still love the vast functionality of ACF and use it on every project I ever create since I first met it.

    One little problem arose, maybe there is a trick I don’t know. In order to create clickable links, I have a repeater with three fields, a title, a teaser and a link field. The latter gives a select to the backend users where they can choose a page the teaser should link to. Can I in some way restrict the choices to only offer childpages of a specific page?

    All the best & thanks in advance


  • physalis can you help me with a urgent problem?

    I get no answer from anywhere.
    I have a problem – Ive 100 posts in my theme which are shows in a hop and coming festival. I bought Events Calendar Pro but when I click a date event on there it rightfully only shows the event page. But I want to relate it to show only my styled themed post instead. Therefore I sent up a custom field page_link for each event and they are related now in the event editor to their respective standard posts.
    But my question is how can I actually trigger it to DISPLAY my post on the screen. I need some code to display the result of the custom_field link somehow… Please please can you help?

  • Hey there,

    the question and its fittings seem a bit remote to me, since I actually don’t know the plugin and how you can manipulate it (has it its own templates?). However, you can retrieve the value of a field and give it back by the simple the_field(); function. E.g. if you’re inside the loop, having a field named eventlink that links to a post or page could be used as such:

    <a href="<?php the_field('eventlink'); ?>">Read more</a>

    This would create a link to your post linked to from the backend instead of the plugin’s event page.

    This is pretty basic usage of ACF which you can read all over the documentation, so I fear this is not what you actually need?



  • Yeah I just want the event calendar to open up my regular post rather than the event’s custom styled post. The field’s in there – its related – instead of the read more I just want it to open the url!

  • Then you need to edit the template that actually displays your calendar and change the link to the event’s detail page to your custom field’s one as described above. Only I don’t know if the plugin is actually working with editable templates or not. Usually there are template files included with the plugin or you can create a new one, but that depends on the plugin you use.

    Do you have a basic notion of how to actually use the custom fields you create with ACF?

  • I would of course be glad to get a hint on how to solve the initial question as well 😉 .

  • Funny, I just came here and was searching the forums for your exact issue. I don’t have a solution, but just wanted to chime in that I am looking to do exactly the same thing. I’ve actually run into quite a few projects where this would have come in handy.

    The current project I’m working on has over 60 pages, and I want to use a relationship field but only have them choose from the child of a specific parent (roughly 5 currently). Would make it so much easier for the client rather than having them scroll through 50+ pages or manually search for each.

  • I have the exact same problem as the title. Still searching, will keep this post updated if I find something.

    Found the solution here:

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Relationship: only use childpage of a page’ is closed to new replies.