Conditional for Singular template if default page
-
Generally, when I want to add a class to the body tag based on when the page.php is the default page template and being used, I would use this function:
if(basename(get_page_template()) === 'page.php'){ $classes[] = 'default-page'; }
However, if singular.php is being used instead because page.php is not part of my theme, but I still want to add a body class if a page is using the default template, is there a method to achieve this?
In a sense, the conditional would be that if the default page template is being used, add this class to the body when the default page is using singular.php.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Conditional for Singular template if default page’ is closed to new replies.