Note that there are some explanatory texts on larger screens.

plurals
  1. POphp: how to add odd/even loop in array
    primarykey
    data
    text
    <p>here is my code: <a href="http://www.pcgage.net/code.zip" rel="nofollow noreferrer">http://www.pcgage.net/code.zip</a> (sorry, pasting the code caused it to really mess up, even using the code container).</p> <p>Scroll to line: 160 (to 174) - this is the loop in question. i want to make it so this is the even part, and then some code to make an odd part, so the loop repeats in this order. The reason is that i want to change the content of this loop alternately.</p> <p>I am not a coder, so the best thing you could do is to post up the new code and i'll add it in where you tell me too, otherwise i'll get lost :)</p> <p>Hope that makes sense, if not you can check an earlier post about this issue that explains why i need this (after finding out that css alone cannot solve my problem): <a href="https://stackoverflow.com/questions/1401269/css-php-how-to-solve-this-div-float-problem-odd-even-loop-in-array">css/php: how to solve this div float problem / odd even loop in array</a></p> <p>this is the loop:</p> <pre><code>} elseif ( ( $findpost-&gt;ID ) != $id ) { // all other posts except the current post $serp_list_li[] = '&lt;div class="serial-contain"&gt; &lt;div class=""&gt;&lt;h5&gt;&lt;a href="' . get_permalink($findpost-&gt;ID) . '" title="' . $findpost-&gt;post_title . '"&gt;' . $findpost-&gt;post_title . '&lt;/a&gt;&lt;/h5&gt;&lt;/div&gt; &lt;div class="text-align"&gt;' . $findpost-&gt;post_excerpt . ' &lt;/div&gt; &lt;div class="date"&gt; ' . mysql2date('M jS, Y', $findpost-&gt;post_date) . ' at ' . mysql2date('g:ia', $findpost-&gt;post_date) . '&lt;/div&gt; &lt;div class="comments"&gt;&lt;a href="' . get_permalink($findpost-&gt;ID) . '#comments" title="' . $findpost-&gt;post_title . '"&gt;&lt;b&gt;' . $findpost-&gt;comment_count . ' Comments&lt;/b&gt;&lt;/a&gt;&lt;/div&gt; &lt;/div&gt;' . "\n"; } else { </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload