SyntaxFix
Write A Post
Hire A Developer
Questions
I suspect there are many answers like this on SO but here you go:
if ( typeof pagetype !== 'undefined' && pagetype == 'textpage' ) { ... }