phdev Posted March 26, 2008 Share Posted March 26, 2008 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];"); ?> Of course this is not working. Can someone help? Link to comment https://forums.phpfreaks.com/topic/97925-php-including-a-wordpress-custom-field/ Share on other sites More sharing options...
soycharliente Posted March 26, 2008 Share Posted March 26, 2008 Try? <?php $submenu_exercises = get_post_custom_values(submenu_exercises); $myfile = $submenu_exercises[0]; include("http://www.sitename.com/common/submenu/$myfile"); ?> Link to comment https://forums.phpfreaks.com/topic/97925-php-including-a-wordpress-custom-field/#findComment-501003 Share on other sites More sharing options...
phdev Posted March 26, 2008 Author Share Posted March 26, 2008 THANKS that worked! Link to comment https://forums.phpfreaks.com/topic/97925-php-including-a-wordpress-custom-field/#findComment-501008 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.