I have a content type including two fields: First name(node title) and Last name(text field) In node.tpl I want to print first name and last name sequentially.
I use the following code to do this but it prints first name and last name in seperate lines.That's because last name is wrapped in a div.Is there any way to get raw text of the last name field?
<?php print $node->title . render($content['field_last_name']);?>
Try this out:
<?php
print $content['field_phone_number'][0]['#markup'];
?>
Simply replace the 'field_phone_number' with 'field_last_name'. You can do the same for the first name too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With