Support » Fixing WordPress » Displaying php code within php echo

Viewing 3 replies - 1 through 3 (of 3 total)
  • try:

    if ( is_user_logged_in() ) {
    echo ('<div id="topBanner"></div>');
    } else {
    echo ('<div id="panel">
    <div id="panel_contents"> </div>
    <div class="innerContainer clearfix">
    <h1>Login to the customer area using the fields below:</h1>'); sidebarlogin(); }; ?>

    btw:
    there are a lot of opened divs in the ‘else’ part of the code; have you taken care to close these divs later?

    Thread Starter paulwallas

    (@paulwallas)

    Yeah i have closed these off, i just didn not include them on the post. I will give this a try, thanks

    Thread Starter paulwallas

    (@paulwallas)

    It works, final code is below:

    if ( is_user_logged_in() ) {
    			echo ('<div id="topBanner"></div>');
    			} else {
    			echo ('<div id="panel">
    						<div id="panel_contents"> </div>
    							<div class="innerContainer clearfix">
    							<h1>Login to the customer area using the fields below:</h1>'); sidebarlogin(); echo ('</div>
    					</div>
    					<div class="innerContainer clearfix">
    						<div class="panel_button"><a href="#">Customer Area</a></div>
    						<div style="display: none;" id="hide_button" class="panel_button"><a href="#">Close this box</a></div>
    					</div>
    				  </div>'); }; ?>

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying php code within php echo’ is closed to new replies.