• Is it me or is this function not working if Permalink is Not set…
    I left my permalink structure as numerical post ids ?p=1 and ran the function:
    is_singular( 'post' );
    But it returns as false…

    Same with is_singlefunction

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s you? Works for me. If you use “pretty” permalinks, does the same code return true? is_singular() works from $wp_query properties which are independent of permalink settings. It seems your theme or one of your plugins is messing with $wp_query properties for this to happen to you.

    Try switching to a default twenty* theme and deactivating all plugins. Revisit the permalinks settings screen for good measure. This causes rewrite rules to be regenerated. is_singular() should now behave properly. Restore your theme and plugins, one at a time, until the problem recurs. The last activated module is the culprit.

Viewing 1 replies (of 1 total)
  • The topic ‘is_singular( ‘post’ ) Doesn’t work if permalink is not set’ is closed to new replies.