I have a basic loop within single.php Also the class .title_name within style.css hooked up with functions.php i.e all is set and working. My code snippet below:
<?php
while(have_posts()) {
the_post();
?>
<!-- HTML STARTS HERE -->
<h2 <?php echo $titleTemplate; ?> ><?php the_title(); ?></h2>
<!-- HTML ENDS UP HERE -->
<p><?php the_content(); ?></p>
<?php } ?>
<?php
if (is_single()) : return $titleTemplate = 'class="title_name"';
endif; ?>
As far as I am considered I have to write simple IF statement which checks if I am within any post, if true It should return a variable with some class assigned to. After I just do echo within desirable opening tag elment but no result at all. Maybe it's scope issue. I am not very familiar with wordpress coding nor php itself yet so any help would be appreciated.