I am including a partial file both in header.php
and in footer.php
with get_template_part('content-form');
Is there an if
clause I can use to check from where the file is being called? If it is called from within footer.php
, then I would like to add a class name.
<div class="default-class <?php if (called_from_footer) echo 'footer-class'; ?>">
</div>
I could do this and style accordingly if there isn’t a better solution, I am just curious:
<div class=footer-container">
<?php get_template_part('content-form') ;?>
</div>