Skip to content

Instantly share code, notes, and snippets.

@michaeldhopkins
Forked from anonymous/gist:8560272
Last active January 4, 2016 03:09
Show Gist options
  • Save michaeldhopkins/8560279 to your computer and use it in GitHub Desktop.
Save michaeldhopkins/8560279 to your computer and use it in GitHub Desktop.
<ul class="ortho-in-motion cf"><?php
$i = 0;
$number_of_posts_output = 0;
$number_of_posts_output_by_doctor = 0;
$length_of_xml = count($xml->channel); //I forget how to do this
foreach ($xml->channel->item as $entry){
$i++;
if (author_of_this_post_is_current_doctor()) {
echo "<li>post</li>";
$number_of_posts_output++;
$number_of_posts_output_by_doctor++;
}
if ($i == $length_of_xml && $number_of_posts_output_by_doctor < 2) {
echo "<li>post</li>";
$number_of_posts_output++;
}
if ($number_of_posts_output == 2) {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment