• I’m sorry if this is in the wrong place, but I’m going crazy trying to figure out what the name of a code inside two percentages is.

    Please help if you can.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Though I don’t believe this one is part of WordPress core, variables like %category% are used as a placeholder and replaced dynamically at run time with another value. (think of it as a template variable)

    In the case of %category%, it’s used to generate permalinks at runtime by replacing %category% with the actual category name based on the category id.

    So that allows WordPress to go from:

    http://example.com/?cat=17

    to

    http://localhost/test-category/

    by internally replacing %category% with “test-category” when the category id is 17. (in my case)

    Not sure I explained it very well. Just think of them as template variables that get replaced with data dynamically at runtime.

    Thread Starter kvschwartz

    (@kvschwartz)

    Thank you, I know what they are, but I need to know what that format is called. Or what the link itself is called.

    Thank you

    In WordPress, they’re called (and used as) Structure Tags.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘What is this code called?: %username%’ is closed to new replies.