0
votes

I have made a custom post template named single-download.php after replicating single.php. However there are certain customizations which I dont want to show on single-download.php but am not able get a specific conditional to achieve the same.

I have tried if(is_page_template( 'single-download.php' )) and also if(!is_page_template( 'single.php' )) but both don't work.

Is there some way in which we can achieve POST template conditioning? Thanks

1

1 Answers

0
votes

Okay I finally figured it out. We need to use

if( !is_singular( 'download' )

OR

if ( is_singular( 'download' ) ) {
// conditional content/code
}

It was that simple :)