Tag Info

Hot answers tagged

1

The very first line contains an incomplete opening PHP tag, it should be <?php not < ?php or some other variation. Also if statements don't require a semi-colon after them. Your code is also not indented correctly. A good editor will auto-indent code for you automatically. A good editor will also syntax check and point out errors as you type them. ...


1

You need to use get_field function here instead of the_field. function wrapImagesInDiv($content) { if ( in_category( 'projects' ) ) { $pattern = '/(<img[^>]*class=\"([^>]*?)\"[^>]*>)/i'; $replacement = ' <div class="owl-wrapper"> <div class="owl-item $2"> ...


1

Rather than outputting your terms in that initial loop, I would use it instead to build a new array, with your issue_date as the key: $my_new_array = array( ); foreach ( $terms as $term ) { $issue_date = get_field( 'issue_date', $term ); $my_new_array[$issue_date] = $term->name; } You can then loop through this new array in order: ksort( ...


1

Thanks Vancoder for your help!!! I have been ripping my hair out all day trying to figure it out. Funny enough your solution was one of half a dozen I wrote on my whiteboard, BUT I had no clue how to actually create an array with that as a key. I am a noob like that. Below is the code I ended up using with some comments for anyone else trying to do this! ...



Only top voted, non community-wiki answers of a minimum length are eligible