add-page functionality
-
I’m relatively new to WordPress and to PHP, so please forgive any idiocy.
I’m running a plugin (WP-Carousel) on a template for a page I’m designing/developing. That template will be used for several pages in the site. The content of each carousel, however, must be different.
This is all well and good when I am setting things up and configuring each individual carousel in the back-end via php. I am actually currently using conditional php to let each individual carousel gallery be pulled in, depending on the page’s name.
However, I need a way for my client to be able to add a new page using that same template, while being able to pull in a carousel that has a unique ID and unique content, all while never touching code.
Is this possible?
Essentially, the WP-Carousel plugin requires that I enter
<?php wp_carousel(CAROUSEL'S ID); ?>
into the template, wherever I want the carousel to appear. The ID# is automatically assigned to a carousel based on the order in which you create them — you have no choice in naming it. So my first Carousel has an ID# of 0, the second has an ID# of 1, etc.
So, is there any way for me to add php to a template that would allow the client to add meta-data to a page — that would then allow that page to recognize and display a certain gallery with a certain ID number? Could I somehow use slugs or custom fields with some kind of <?php get_meta…?> code which I then use to populate the wp_carousel() call?
Any help would be much appreciated.
- The topic ‘add-page functionality’ is closed to new replies.