PHP in variable?
-
Hi there – i have a question about php.
I use “smooth slider” old version and I’d like to have something that calls a custom field.
I’ve found the code where I’d love to let the custom field show up. But after hours, I don’t get it to work. I think it’s just an easy noob mistake:
Here is the code:
$html .= sslider_get_the_image($img_args); if(!$smooth_slider['content_limit'] or $smooth_slider['content_limit'] == '' or $smooth_slider['content_limit'] == ' ') $slider_excerpt = substr($slider_content,0,$smooth_slider['content_chars']); else $slider_excerpt = smooth_slider_word_limiter( $slider_content, $limit = $smooth_slider['content_limit'] ); if ($smooth_slider['image_only'] == '1') { $html .= '<!-- /smooth_slideri --> </div>'; } else { if($permalink!='') { $html .= '<h2 ><a href="'.$permalink.'">'.$post_title.'</a></h2><span> '.$slider_excerpt.'</span> <p class="more"><a href="'.$permalink.'">'.$smooth_slider['more'].'</a></p> <!-- /smooth_slideri --> </div>'[....]I tried to make something like
$mymeta = get_post_meta($post->ID, "mycustomfield", true);and I wanted to have it in the Title:`.$post_title.'</a></h2><span>’
So I wrote it like this:
.$post_title.'</a></h2>'.$mymeta.'<span>'but it doesn’t work. I can’t see anything on the frontend.So my question: how can I put “php” into this code to show my custom field value right next to the Title??
Thank you!!!
AD
The topic ‘PHP in variable?’ is closed to new replies.