Timeline for Limit Taxonomy Output in Conditional Statement
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 5, 2016 at 5:29 | vote | accept | Heather | ||
Jun 16, 2016 at 0:58 | comment | added | Howdy_McGee♦ |
You could also filter on term_links-royal_portfolio_cats which passes an array to it - but it doesn't pass args so you don't have access to before or after in order to add the ellipsis.
|
|
Jun 16, 2016 at 0:39 | comment | added | Ismail | Oops. Forgot that one ;) | |
Jun 16, 2016 at 0:32 | answer | added | Heather | timeline score: 2 | |
Jun 16, 2016 at 0:29 | comment | added | Heather |
That worked! Except I had to use $term_array instead of if ( count( $terms ) > $max ) { echo " ..."; }
|
|
Jun 16, 2016 at 0:14 | comment | added | Ismail |
Try this if ( $limit = array_slice($term_array, 0, $max = 5) ) { echo implode( ", ", $limit ); if ( count( $terms ) > $max ) { echo " ..."; } } after $term_array
|
|
Jun 15, 2016 at 23:27 | history | asked | Heather | CC BY-SA 3.0 |