Custom Fields for Template (problem, seems like a bug)
-
Hey
I’m using WP as a CMS for this website right here:
https://greenlife.ciplex.ws/our-roots
This is an example page, not post.My problem right now is that each sub-page has its own color theme and image for the content area. I do not want to allow the client to mess up the templates by leaving a ton of markup in each individual page.
My solution was going to be to use custom fields (as well as the Get Custom Field Values plugin) to tell my template what page it is on and what css to use or what image to place on the right side.
I have two custom fields. One called “wrapper” that I’m using as a variable to switch the IDs for certain div’s and thus I can control it on a per-page basis thru my stylesheet afterwards. The second field is called “secondary”, which is what I’m using for the accompanying image next to the content area.
Do note that I am using my custom fields outside of the loop because to put the loop elsewhere would give the client too much control and would probably mess up the site in due time.
The bug that I think I’m experiencing is only allowing my pages to have one value for each key. Any time I put a new value for “wrapper” on the page I need it on it either a) does not update at all or it, b) changes it for all of the pages instead of the one I’m updating. The same goes for the “secondary” key.
Can anybody help me figure out if I’m updating the Custom fields wrong? Or if this is a bug I need to work around? or do I need to give up on this technique?
- The topic ‘Custom Fields for Template (problem, seems like a bug)’ is closed to new replies.