<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>Add Class after every 2nd record</title>
        <link>https://interactivetools.com/forum/forum-posts.php?Add-Class-after-every-2nd-record-80022</link>
        <description></description>
        <pubDate>Mon, 20 Apr 2026 06:21:59 -0700</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;Add-Class-after-every-2nd-record-80022" rel="self" type="application/rss+xml" />

                <item>
          <title>Add Class after every 2nd record</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236544#post2236544</link>
          <description><![CDATA[<p>thanks Jerry</p>
<p>that worked great cheers.</p>]]></description>
          <pubDate>Thu, 09 Apr 2015 15:05:03 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236544#post2236544</guid>
        </item>
                <item>
          <title>Add Class after every 2nd record</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236541#post2236541</link>
          <description><![CDATA[<p>Hi Craig,<br /><br />Can’t get to testing this right now, but the approach I’d use is to add and increment a counter in your foreach record loop. <br /><br />Then use an if statement around your &lt;div&gt; tag that looks for a counter value of 2, and if that condition is met, display the special code and reset the counter to a value of 0.<br /><br />Something like this:</p>

<p><code>&lt;?php $count = '0' ?&gt; <br /> &lt;?php foreach ($testimonials_listPages as $record): ?&gt;<br /> &lt;?php $count++ ?&gt;<br />  &lt;?php if($count == 2 ):?&gt;<br /> &lt;?php $count = '0' ?&gt;<br /> &lt;div class="one_half  animate" data-anim-type="fadeInLeft" data-anim-delay="100"&gt; &lt;?php else : ?&gt; &lt;div class="your_other_class”&gt;&lt;?php endif ?&gt;<br /> ... the rest of your code...</code></p>
<p><br />Hope that helps,<br /><br />Jerry Kornbluth</p>]]></description>
          <pubDate>Thu, 09 Apr 2015 09:43:53 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236541#post2236541</guid>
        </item>
                <item>
          <title>Add Class after every 2nd record</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2236538#post2236538</link>
          <description><![CDATA[<p>Hi Guys</p>
<p>i have section that stores testimonials and the issue is that after every 2nd record i need to add a class to the div class. on the Div &lt;div class="one_half  animate" data-anim-type="fadeInLeft" data-anim-delay="100"&gt; i need to add on the class so it is bold text to the right after the 2nd record so record 1 dosnt have it but the 2nd record does. &lt;div class="one_half  <strong>last</strong> animate" data-anim-type="fadeInLeft" data-anim-delay="100"&gt;</p>


<p>                &lt;?php foreach ($testimonials_listPages as $record): ?&gt;<br />                &lt;div class="one_half  animate" data-anim-type="fadeInLeft" data-anim-delay="100"&gt;<br />                    &lt;div class="box"&gt;" &lt;?php echo textLimitTestimonials ($record['content'], 300) ?&gt;&lt;br&gt;<br />                        &lt;a href="&lt;?php echo $record['_link'] ?&gt;" class="button eleven"&gt;..read more&lt;/a&gt;<br />                    &lt;/div&gt;<br />                    <br />                    &lt;div class="who"&gt;<br />                    <br />                        &lt;?php foreach ($record['logo'] as $index =&gt; $upload): ?&gt;<br />                        &lt;img src="&lt;?php echo $upload['thumbUrlPath'] ?&gt;" alt="&lt;?php echo htmlencode($record['title']) ?&gt;" title="&lt;?php echo htmlencode($record['title']) ?&gt;"/&gt;<br />                        &lt;?php endforeach ?&gt;<br />                        &lt;strong&gt;&lt;?php echo htmlencode($record['title']) ?&gt;&lt;/strong&gt;<br />                        <br />                    &lt;/div&gt;<br />                &lt;/div&gt;<br />                &lt;?php endforeach ?&gt;<br /><br /></p>]]></description>
          <pubDate>Thu, 09 Apr 2015 02:22:53 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2236538#post2236538</guid>
        </item>
              </channel>
    </rss>
  