Help with syntax problem for get_image_with_alt
-
What is wrong with my syntax on the following line? Trying to pull a random quote, the title and author both work but am having trouble with the get_image_with_alt line.
$quote .= get_image_with_alt('.$rows[$i]['cover'].', get_the_ID(), '');
The full function
function getQuote() { if(get_field('books', 34)) { $rows = get_field('books', 34); $row_count = count($rows); $i = rand(0, $row_count - 1); echo $rows[$i]['sub_field_name']; $quote .= '<blockquote>'; $quote .= get_image_with_alt('.$rows[$i]['cover'].', get_the_ID(), ''); $quote .= '<div class="quote-holder">'; $quote .= '<q>“'.$rows[$i]['title'].'â€</q>'; $quote .= '<cite>— '.$rows[$i]['author'].'</cite>'; $quote .= '</div>'; $quote .= '</blockquote>'; } return $quote; }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.