Please help me in concantination of html tags to be echo in php

Discussion in 'PHP' started by PinoyEngine™, Dec 23, 2011.

  1. #1
    Guys, I need to embed this html tags in my php code for my wordpress theme

    here is the html:

    <h1 class="pambungad"><?php _e('Welcome to', 'ad'); ?> <?php _e('Article Directory', 'ad')?></h1>
    Code (markup):
    and here is the php code:

    <?php if (is_home() ) { echo 'HERE' ;} else { echo 'Nothing to do here' ;} ?>		
    Code (markup):
    I want the html code to be echo in 'HERE'

    but of course as you can see it won't work as I am using single and double quotes at the same time.

    [​IMG]

    Please help me.

    Thanks in advance and more power.
    Any kind of help s greatly appreciated.
     
    Last edited: Dec 23, 2011
    PinoyEngine™, Dec 23, 2011 IP
  2. proactiv3

    proactiv3 Peon

    Messages:
    55
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    0
    #2
    proactiv3, Dec 23, 2011 IP
  3. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #3
    <?php if (is_home() ) { echo "<h1 class='pambungad'><?php _e('Welcome to', 'ad'); ?> <?php _e('Article Directory', 'ad')?></h1>"; } else { echo 'Nothing to do here' ;} ?>
    PHP:
     
    MyVodaFone, Dec 23, 2011 IP
  4. PinoyEngine™

    PinoyEngine™ Well-Known Member

    Messages:
    298
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    #4
    Sir, tried it but, the php were lost its inclusion in h1 tags.
    Sir, the
    _e('Welcome to', 'ad'),
                _e('Article Directory', 'ad'
    Code (markup):
    Should still be inside h1 tags.

    Sir, that is also my problem, it won't work because I am using double and single quote on my html.

    Thanks guys.
     
    PinoyEngine™, Dec 23, 2011 IP
  5. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #5
    Did you actually try the line I code I provided, because it is altered to accommodate quotes.

    Are you getting any kind of error ?
     
    MyVodaFone, Dec 23, 2011 IP
  6. PinoyEngine™

    PinoyEngine™ Well-Known Member

    Messages:
    298
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    145
    #6
    Sir, yes sir, but the generated code is not enclosed in h1 tags. Actually, the h1 tag is not closed.

    It generates this:
    Welcome toArticle Directory<h1 class="pambungad"> </h1>
    Code (markup):
    thank you very much sir.
     
    PinoyEngine™, Dec 23, 2011 IP