Support

Account

Home Forums Front-end Issues Output a page for a field value? Reply To: Output a page for a field value?

  • You used a field group, but did you use a taxonomy field or eventually create a custom taxonomy? If this were the case the standard WP template hierarchy would manage this by creating a template for the taxonomy. I’m not sure if I covered that or not in the other discussion.

    If not then this is going to be difficult to do. There may be other methods, but this is what I would do if I needed to create a dynamic page based on only an ACF field.

    1) I would create a “Page” post. This will be used similar to the WP page_on_front or page_for_posts, page. It’s basically a place holder page.

    2) I would create a custom template file to be used on this page. This template file would dynamically generated.

    3) Links would need to include a query variable, for example ?company-type=some-company-type

    4) Use the query variable in 3 to dynamically generate the content for 2

    Alternately, instead of a query string variable in the url you could have the page named something like `https://www.yoursite.com/company-type/{$COMPANY_TYPE} and then add custom rewrite rules to WP to transform the URL and add the correct query string. I would probably do this, but the details of doing this are not something I know off the top of my head.