conditional statement for active permalinks

I’m looking for a way to create an if…else statement hinging on whether pretty permalinks are active or not. So I need something which returns true when permalinks are changed from the default.

if (pretty_permalinks_are_on) {
   do this;
    } else {
       do that;
    }

Sort of thing. Just have no idea about the ‘pretty_permalinks_are_on’ part.

Read More

If anyone would extend the hand of compassion and throw some crumbs to a php noob, I’d be a grateful learner 🙂

Related posts

Leave a Reply

1 comment

  1. get_option( 'permalink_structure' ) is your friend. If you’re using the default it will be set as an empty string:

    if( get_option( 'permalink_structure' ) !== '' ) {
        // custom permalink enabled code
    } else {
        // no permalink 
    }