php if else wordpress
<?php
if ( is_single() ) {
// Code to execute if the current page is a single post
echo 'This is a single post.';
} elseif ( is_page() ) {
// Code to execute if the current page is a static page
echo 'This is a static page.';
} else {
// Code to execute if the current page is neither a single post nor a static page
echo 'This is neither a single post nor a static page.';
}
?>