Timeline for What's the Simplest Way to Override/Rewrite the %category% Permalink Structure Tag?
Current License: CC BY-SA 4.0
3 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 1, 2021 at 12:32 | vote | accept | CommunityBot | ||
Jan 1, 2021 at 10:42 | comment | added | Sally CJ |
Try again with my first example: copy the exact code, paste it into the theme functions.php file, and change the meta key (I see you used pc_primary in the question). Also, yes, the else part isn't needed since WordPress already did that which the value is the one you're changing/filtering. Additionally, instead of get_the_ID() , you should use $post->ID .
|
|
Jan 1, 2021 at 9:20 | history | answered | Sally CJ | CC BY-SA 4.0 |