Execute PHP within custom field
I’m trying to execute a small bit of PHP on a page. I can add it to the template, but that won’t work, seeing as that each page will have a different ID.
The code I’m including is
<?php echo rating_bar('unique','5'); ?>
The “unique” will be different in each page/post. I could use the code within the post/page itself, but that can get sloppy in regards to my template, theme, and will be difficult to put the code in the same spot, for everyone posting.
I tried adding a custom field. It gets output into the template where I called it, but doesn’t actually execute the PHP, it just gets output as text.
Is there a way I can force the custom field to execute the PHP, instead of just dumping it into the template?
- The topic ‘Execute PHP within custom field’ is closed to new replies.