• Resolved bsapaka

    (@bsapaka)


    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)
  • 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

    (@bsapaka)

    it’s what’s default in the theme

    Thread Starter bsapaka

    (@bsapaka)

    does that affect whtether or not my html works?

    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.

    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

    (@bsapaka)

    ah yes!

    That fixed it.

    Thank you!

    Np

    Mark as resolved please 😉

    Thread Starter bsapaka

    (@bsapaka)

    resolved

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘html code inside php file’ is closed to new replies.