A sneaky custom field php idea
-
I’ve got a custom field named “social”. I would like to use a custom field to kind of pull off a php include maneuver here. So, I thought that maybe I could use “social.php” for the value and then wrap that with the rest of the php include code. So the get_post_meta would grab the custom field value and create the php include. Something like this, but that works.
<?php echo get_post_meta($post->ID, ‘<?php include(“/images/’,’social’,'”); ?>’, true); ?>
I know just enough php to be dangerous. But right now, I’m feeling pretty harmless.
- The topic ‘A sneaky custom field php idea’ is closed to new replies.