Timeline for get_terms name__like list categories according to letter
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 21, 2015 at 16:32 | comment | added | TheDeadMedic |
It's because surname is not a core query argument, so WordPress thinks it's the same query as A and returns a cached result. Add 'name__like' => $letter to $args in addition to surname.
|
|
Feb 21, 2015 at 16:05 | comment | added | ndru | hey this solution works if I want to list all categories with letter 'E' in this specific position but if I want to use it in a loop it somehow doesn't work. plz see my edit on the original question | |
Feb 18, 2015 at 12:56 | vote | accept | ndru | ||
Feb 18, 2015 at 12:54 | history | edited | TheDeadMedic | CC BY-SA 3.0 |
deleted 6 characters in body
|
Feb 18, 2015 at 12:54 | comment | added | TheDeadMedic | Woah, wrong filter! See edit. | |
Feb 18, 2015 at 12:45 | comment | added | ndru |
looks good, but I somehow can't get it to work. I posted your function exactly like it is in my functions.php. Then I put it in use on my page template and have it echo out the category list through a foreach loop $cats = get_terms( 'category', 'surname=E' );foreach($cats as $cat){... it still prints all the categories though and not the one's with "E"'s on the beginning etc.
|
|
Feb 18, 2015 at 11:54 | history | answered | TheDeadMedic | CC BY-SA 3.0 |