Site logo

Archived topic

Custom page with variable in url (not custom page theme)

7 replies · Started by Simon Wagemyr on May 19, 2021

Viewing posts 1–8 of 8

Howdy!
Trying to figure out how to build a custom page with url-variable. I'm looking to use ACF as the base of generating content. So, not wanting a custom page template, but a page that simply loads whatever is in the custom fields (that part of the php/html/css is not an issue) without having to create a new "page" for it, simply put. I otherwise want the page to have the look-and-feel of a normal page. I only really need a starting point, the rest will fall into place if I figure out that one part, and hoped you might be able to help out.

Hi there,

I'm not exactly sure I fully understand what you're trying to do.

but a page that simply loads whatever is in the custom fields (that part of the php/html/css is not an issue) without having to create a new “page”

Are you trying to automated page creation from a list of field values?

This isn't something the theme controls as this requires automation of the WordPress core function related to the creation of pages.

Are you trying to make generated static pages or posts that is pre-formatted to display ACF field values?

The latter

posts that is pre-formatted to display ACF field values

Hi Simon,

You can try block elements with dynamic content.

Set the block element as a hook, so you can insert it to the places you want for your post, then use the dynamic data to call the ACF filed.

Here's a demo video that uses the custom field value in a block element.
https://youtu.be/H6wHd83DfDI

Hope that's helpful :)

That doesn't really seem to fit what I'm after. I can just create a short code to do what I want and use it on a page, but I was hoping to skip the step of having to create a page and just have a dynamic link that includes the integer representing a category (which has all the relevant custom fields tied to it). The reason for this is to minimize administration as much as convincingly possible for the people that will run the page later on.

I might have to go with my original idea, but thanks for the input (might be useful in other cases).

CS at GP is always top notch, appreciate the dedication! :]

I can just create a short code to do what I want and use it on a page

If so, you can add this short code into a hook element, then the short code content will automatically show in each post.

Hope I understand you correctly :)

Ahaaaa...

I'll have to rethink where I put the custom fields for this approach, but the end result could possibly be the same. :]

I'll tinker around, I feel confident I can work something out this way. Grazzi!

Good luck!

Hope it will work out :)

This archived topic is closed to new replies.