PHP-include a wordpress custom field?

Status
Not open for further replies.

crossfittn

Afro Blue
Feb 4, 2007
1,135
8
0
TN
topyc.io
Hey guys,

I have a wordpress based site and I have special submenus for certain types of posts on the site, using a custom field for the submenu.

Example:
<?php $exercises = get_post_custom_values(exercises); print $exercises[0]; ?>

This forces me to manually update all posts with new menu html code that would have new menu items i just added.

I want to be able to use php include to include a menu html file instead, but I do'nt know PHP.... This is what i'm trying:

<?php include("http://www.sitename.com/common/submenu/$submenu_exercises = get_post_custom_values(submenu_exercises); print $submenu_exercises[0];"); ?>

My goal is for my custom field to just be "exercises.html"

Of course this is not working. Can someone help?
 


Never mind, got it... For anyone who wanted to know.......

<?php
$productmenu = get_post_custom_values(productmenu);
$myfile = $productmenu[0];
include("http://www.sitename.com/$myfile");
?>
 
Status
Not open for further replies.