Title: html code inside php file
Last modified: August 21, 2016

---

# html code inside php file

 *  Resolved [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/)
 * I just need a few simple strings of html code inside my home.php (theme minimatica)
   so that I can display some text below the slider.
 * between these two chunks:
 *     ```
       <?php else : ?>
       	<div id="container">
       		<?php get_template_part( 'loop', 'index' ); ?>
       		<?php get_sidebar(); ?>
       		<div class="clear"></div>
       	</div><!-- #container -->
       ```
   
 * and
 * `<?php endif; ?>`
 * is where I placed my html. I opened with <html> did all my business and closed
   with </html>
 * no luck as it shows nothing. What do I do to make this work?

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

 *  [Kåre Mulvad Steffensen](https://wordpress.org/support/users/dejliglama/)
 * (@dejliglama)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220538)
 * Maybe we need a bit more context regarding the code you put in..
 * In the above case, i’m wondering what the very first line of PHP is doing, since
   you arn’t gettimg whats inside of this php ELSE clause…
 *  Thread Starter [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220542)
 * it’s what’s default in the theme
 *  Thread Starter [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220543)
 * does that affect whtether or not my html works?
 *  [wpfan1000](https://wordpress.org/support/users/wpfan1000/)
 * (@wpfan1000)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220546)
 * I think the html tags are already assumed by the template processor.
 * Just like the html on the 2nd line of your code chuck above:
 *     ```
       <div id="container">
       ```
   
 * does not need to be wrapped in <html> tags, neither does any of your html code.
 *  [Kåre Mulvad Steffensen](https://wordpress.org/support/users/dejliglama/)
 * (@dejliglama)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220650)
 * Ah, so to put in more html within this chunk of code :
 *     ```
       <?php else : ?>
       	<div id="container">
       		<?php get_template_part( 'loop', 'index' ); ?>
       		<?php get_sidebar(); ?>
       		<div class="clear"></div>
       	</div><!-- #container -->
   
       <?php endif; ?>
       ```
   
 * It would look like this:
 *     ```
       <?php else : ?>
       	<div id="container">
       		<?php get_template_part( 'loop', 'index' ); ?>
       		<?php get_sidebar(); ?>
       		<div class="clear"></div>
       	</div><!-- #container -->
       <div id="newchunkofhtml">
       <a href="#">any type of html goes here</a>
       </div>
       <?php endif; ?>
       ```
   
 * All that code:
 *     ```
       <div id="newchunkofhtml">
       <a href="#">any type of html goes here</a>
       </div>
       ```
   
 * can of course be changed into what ever – except <html> and <body> tags and other
   overall-structual tags, since you are already inside an html page.
 * However the entire code you have shown won’t be shown unless the ELSE parameter
   is TRUE..
 * Makes sense ?
 *  Thread Starter [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220653)
 * ah yes!
 * That fixed it.
 * Thank you!
 *  [Kåre Mulvad Steffensen](https://wordpress.org/support/users/dejliglama/)
 * (@dejliglama)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220688)
 * Np
 * Mark as resolved please 😉
 *  Thread Starter [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * (@bsapaka)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220698)
 * resolved

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

The topic ‘html code inside php file’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 3 participants
 * Last reply from: [bsapaka](https://wordpress.org/support/users/bsapaka/)
 * Last activity: [12 years, 10 months ago](https://wordpress.org/support/topic/html-code-inside-php-file/#post-4220698)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
