Pass display parameters or attributes to custom page template
-
Hello. Really helpful plugin! I am using the Insert Pages plugin version 3.2.8 with WordPress version 4.9. I am also using Advanced Custom Fields version 5.6.5 and Custom Post Types UI version 1.5.6. I reviewed the support forum and didn’t quite find an existing topic like this. My apologies if this is something that you have already addressed.
I am using a custom page template and my Insert Pages shortcode looks like this:
[insert page=’default-page’ display=’MyCustomPgTemplate.php’]I need to use the Insert Pages shortcode multiple times on the same page. Let’s say I have a page for book genres and I have 4 sections on that page for each genre (Fantasy, Time Travel, Post-Apocalyptic, and Sci-Fi Horror). My custom page template displays different book titles based on the specified genre. How can I pass that genre from your shortcode to my page template?
Is there a way to do this without modifying the Insert Pages code so that it doesn’t break with updates? I’m thinking something like this:
[insert page=’default-page’ display=’MyCustomPgTemplate.php?genre=fantasy’]I thought of using the shortcode $attr, but how can I pass the attributes from your shortcode to the page template without touching your shortcode handler?
Thank you very much in advance!
- The topic ‘Pass display parameters or attributes to custom page template’ is closed to new replies.