There is a template part called ‘theme-section-1.php’, and a css file called ‘theme-section-1.css’.
I want to load the css file only if ‘theme-section-1.php’ is called. an if/else statement loads the template which is controlled by a checkbox in the dashboard.
2
Answers
You can simply do this by :
is_page_template()
does exactly thatThe
path/to/template
starts from your theme directory