How to present a div only when the index.php is accessed for/by the single post pages August 12, 2022 by Tarik Billa The syntax is wrong. Write the condition as: if (is_single()) { your code here }