The code below will exclude the content type ‘name’ from being printed on a Page and Story type. Question, how can I do the opposite of this and print the content type name on only a Page and Story type?
<?php
if (!in_array($node->type, array('story', 'page'))) {
print node_get_types('name', $node);
}
?>
I removed the (!) and it works. How can I embed a css style into this scprit. I get error when I tried it this way. I just need the style to show on Page or Story types.
<?php
if (in_array($node->type, array('story', 'page'))) {
<div class="mystyle">
print node_get_types('name', $node);
</div>
}
?>
I got the css style in using ‘print’
<?php
if (in_array($node->type, array('story', 'page'))) {
{ print '<div class="mystyle"> ';
print node_get_types('name', $node);
}
print '</div>';
}
?>
Assuming I understand the question correctly, just remove the not (!) operator, e.g: