1

I need to make if statements for every permalink structure, so I need to know if there is a function that returns to me the actual selected permalink structure by the user. To make it simple all I need to know is if this permalink:

www.site.com/?p=22;

a condition will apply else if this structure

www.site.com/cat/title

is used then another condition is applied.

So all I need to know is if there is function in Wordpress that can return me what structure the website is using.

4

The structure is stored in the option permalink_structure. Pretty permalinks are disabled if the option is empty.

$structure = get_option( 'permalink_structure' );

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.