Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   How to insert php code into Byline (http://forum.bytesforall.com/showthread.php?t=3163)

JakeThePeg Aug 27, 2009 02:25 AM

How to insert php code into Byline
 
Howdy, I'm inserting the following piece of code into my "Byline: Multi-page posts" field. Instead of being executed, the code is being displayed on my site from the word "val" onwards (highlighted in red below). Why is this?

<?php
$related_posts = MRP_get_related_posts($post_id);
foreach($related_posts as $key => $val) {
$my_query->post->ID = $key;
$my_query->post->title = $val->related_post_title;
the_attached_image('your_parameters=values', $my_query);

}
?>

juggledad Aug 27, 2009 06:16 PM

I believe the $val should be $value - check the PHP syntax for the FOREACH statement


All times are GMT -6. The time now is 10:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.