So something like this?
I've presented the query I'd be using.
Yes it's got shortcut functions that wordpress created.
Code:
$seasonCount = '6';
$sArray = array();
for ($i = 1; $i <= $seasonCount; $i++)
{
$sArray[ ] = $wpdb->get_result("
SELECT post_episode
FROM $wpdb->posts key1
INNER JOIN $wpdb->term_relationships key2
on key1.ID = key2.object_id
WHERE key2.term_taxonomy_id = $categoryID
AND key1.post_status = 'publish'
AND key1.post_type = 'post'
AND key1.post_season = $i
ORDER BY post_episode ASC");
}
If this is the syntax, how would I call it into a looping set of divs?
Something like this?
Code:
<?php for ($i = 1; $i <= $seasonCount; $i++){ ?>
<div>
<?php
foreach ($sArray[$i] as $sArray[$i]) {
echo $sArray[$i];
} ?>
</div>
<?php } ?>
Bookmarks