Title: raj080288's Replies | WordPress.org

---

# raj080288

  [  ](https://wordpress.org/support/users/raj080288/)

 *   [Profile](https://wordpress.org/support/users/raj080288/)
 *   [Topics Started](https://wordpress.org/support/users/raj080288/topics/)
 *   [Replies Created](https://wordpress.org/support/users/raj080288/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/raj080288/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/raj080288/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/raj080288/engagements/)
 *   [Favorites](https://wordpress.org/support/users/raj080288/favorites/)

 Search replies:

## Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How do i add div tags for specific posts only?](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/#post-5682014)
 * thanks!!
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How do i add div tags for specific posts only?](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/#post-5681920)
 * Hi Calvin,
 * I sorted this now, just had to do another if and end if. Thanks for your help.
   You’re truly a star!!!
 * Thank yo very much,I appreciate all your help.
 * Raj
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How do i add div tags for specific posts only?](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/how-do-i-add-div-tags-for-specific-posts-only/#post-5681916)
 * Hi Calvin, thanks for your answer it works great. The only problem is I want 
   2 divs with the same name on the first page and 2 divs with same name on second
   page. Right now its adding the extra 2 div with the same name to both pages.
 * Thanks,
 * Raj
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623790)
 * this is solved. [@stephencottontail](https://wordpress.org/support/users/stephencottontail/)
   thanks fr all your help.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623662)
 * Hi, I solved this. I just useda for loop inside the wordpress while loop to get
   the title of the page and append the “-” plus numbers after it.
 *     ```
       <section class = "container" id="<?php echo get_the_title(); ?>">
           <article class = "row <?php echo get_the_title(); ?>">
                <?php
       	     for($i=1; $i<5; $i++){
       	      $x = $i;
       	     ?>
   
       	    <div id="<?php echo get_the_title() . "-".$x;?>">
       	     <h3><?php the_content(); ?></h3>
                    </div>
                <?php
                 }
       	?>
             </article>
       </section>
       ```
   
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623660)
 * Hi,
 * Thanks for this but the div keeps outputting the same class for all post containers:
 * The code gives the same id name of contact to all container divs and gives a 
   class name of contact-1, contact-, contact-3 to all of the article div.
 * We’re nearly there….
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623564)
 * Any suggestions. Can someone please help,I need to get this done for a client
   ASAP.I would really appreciate any help given.
 * Thanks,
 * Raj
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623555)
 * right now what the code outputs is:
 *     ```
       <div id ="container">
          <div class="Home">Home</div>
        </div>
       ```
   
 *     ```
       <div id ="container">
          <div class="About">About</div>
        </div>
       ```
   
 *     ```
       <div id ="container">
          <div class="Skills">Skills</div>
        </div>
       ```
   
 * <div id =”container”>
    <div class=”Portfolio”>Portfolio</div> </div>`
 * <div id =”container”>
    <div class=”Contact”>Contact</div> </div>`
 * as you can see I am limited to only one class name here. For each class name 
   I would like 3-4 class name added.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623554)
 * it only gets the class name of ONE class which is the title of the page. I want
   to add a few more classes section classes so that I can target them for my parallax
   images. Right now I am limitied to 1 class name per div however, I want more 
   classes to be added.
 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [Add various class to div elements](https://wordpress.org/support/topic/add-various-class-to-div-elements/)
 *  Thread Starter [raj080288](https://wordpress.org/support/users/raj080288/)
 * (@raj080288)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/add-various-class-to-div-elements/#post-5623551)
 * HI,
 * Thanks for the reply. I have tried that method but it keeps outputting random
   class names from wordpress. I need each div, ideally inside the container to 
   have its own class names for e.g
 *     ```
       <div id ="container">
          <div class="class name1 name2 name3>Some content</div>
        </div>"
       ```
   
 *     ```
       <div id ="container">
          <div class="class homeParallax homeParralax2 homeParralax3>Some content</div>
        </div>"
       ```
   
 *     ```
       <div id ="container">
          <div class="class name1 name2 name3>Some content</div>
        </div>"
       ```
   
 * Obviosuly the container tag is looping the posts using the while loop in php.
   I need to add a div inside the container class where each div within it would
   have a unique class or id name – see the example above to see what I mean.
 * I hope this makes sense?

Viewing 10 replies - 1 through 10 (of 10 total)