jimmylew52
asked on
Make two lines of php print one line..
I have a snippet of PHP code that does what I want except it prints on two lines instead of one. It is necessary for it to print on one line. PHP 5.3. any suggestions on how to accomplish this?
<div id="footer" class="c-b">
<div class="footer-inner">
<?php if ($page['footer']): print render($page['footer']); endif; ?>
<div class="c-b"></div>
</div>
<div id="footer-message">
<div class="footer-inner">
<div id="footer"> © 2012. All Rights Reserved. <?php print $footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
</div>
</div> <!-- /footer-message -->
</div> <!-- /footer -->
<div id="footer" class="c-b">
<div class="footer-inner">
<?php if ($page['footer']): print render($page['footer']); endif; ?>
<div class="c-b"></div>
</div>
<div id="footer-message">
<div class="footer-inner">
<div id="footer"> © 2012. All Rights Reserved. <?php print $footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
</div>
</div> <!-- /footer-message -->
</div> <!-- /footer -->
ASKER
These two lines need to print as one.
<div id="footer"> © 2012. All Rights Reserved. <?php print $footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
Tried changing to
<div id="footer"> © 2012. All Rights Reserved.</div> <?php print $footer_message . $footer ?>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
but got the same result.
<div id="footer"> © 2012. All Rights Reserved. <?php print $footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
Tried changing to
<div id="footer"> © 2012. All Rights Reserved.</div> <?php print $footer_message . $footer ?>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
but got the same result.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Looked like <a pr <span might work but they did not. I guess I do not understand.
I don't know if this is helpful but this is your code without styling or other items of code
a) What you are getting
b) What you would like
<!doctype html>
<html>
<head>
<title>Test</title>
</head>
<body>
<?php
$page = array('footer' => 'Some footer text goes here');
$footer = "Some footer text goes here";
$footer_message = "Some additional footer text goes here";
?>
<div id="footer" class="c-b">
<div class="footer-inner">
<?php if ($page['footer']): print $page['footer']; endif; ?>
<div class="c-b"></div>
</div>
<div id="footer-message">
<div class="footer-inner">
<div id="footer"> © 2012. All Rights Reserved. <?php print $footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
</div>
</div> <!-- /footer-message -->
</div> <!-- /footer -->
</body>
</html>
Which produces the following output Some footer text goes here
© 2012. All Rights Reserved. Some additional footer text goes hereSome footer text goes here
If this is not what you want then you have to look at the structure of your text. Maybe post backa) What you are getting
b) What you would like
If thesolution provided by Julian does not work, you should verify the values of ($footer_message and $footer) that does not contain inside some <div> or <p> tags .....
i suggest to post the footer output that you are getting (view source) to be able to help you in a better way.
Good Luck!
i suggest to post the footer output that you are getting (view source) to be able to help you in a better way.
Good Luck!
How about
<div id="footer"><?php print "© 2012. All Rights Reserved.".$footer_message . $footer ?></div>
<a href="http://premiumcmsthemes.com" target="_blank" class="pt_logo"></a>
<?php print $feed_icons; ?>
ASKER
Here is the HTML and the out put on the web site.
<html class="js" dir="ltr" version="XHTML+RDFa 1.0" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<body class="html front not-logged-in two-sidebars page-node">
<div id="skip-link">
<div id="header">
<div id="front-page-wrapper">
<div id="page">
<div id="footer" class="c-b">
<div class="footer-inner">
<div id="footer-message">
<div class="footer-inner">
<div id="footer">© Systrends 2012. All Rights Reserved. </div>
<a class="pt_logo" target="_blank" href="http://premiumcmsthemes.com"></a>
<a class="feed-icon" title="Subscribe to www.systrends.com RSS" href="/?q=rss.xml">
</div>
</div>
</div>
</body>
</html>
webpage.doc
<html class="js" dir="ltr" version="XHTML+RDFa 1.0" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<body class="html front not-logged-in two-sidebars page-node">
<div id="skip-link">
<div id="header">
<div id="front-page-wrapper">
<div id="page">
<div id="footer" class="c-b">
<div class="footer-inner">
<div id="footer-message">
<div class="footer-inner">
<div id="footer">© Systrends 2012. All Rights Reserved. </div>
<a class="pt_logo" target="_blank" href="http://premiumcmsthemes.com"></a>
<a class="feed-icon" title="Subscribe to www.systrends.com RSS" href="/?q=rss.xml">
</div>
</div>
</div>
</body>
</html>
webpage.doc
Ok that outputs
NB your last anchor is not closed
© Systrends 2012. All Rights Reserved.
What do you want it to output?NB your last anchor is not closed
<a class="feed-icon" title="Subscribe to www.systrends.com RSS" href="/?q=rss.xml"> <== no closing </a>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
julianH
Required output
© My Company 2012. All Rights Reserved. (Feed_Icon)
New HTML with current changes:
<html class="js" dir="ltr" version="XHTML+RDFa 1.0" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<body class="html front logged-in two-sidebars page-node toolbar toolbar-drawer admin-menu" style="padding-top: 30px;">
<div id="skip-link">
<div id="overlay-disable-messag e" class="clearfix">
<div id="toolbar" class="toolbar overlay-displace-top clearfix toolbar-processed">
<div id="header">
<div id="front-page-wrapper">
<div id="page">
<div id="footer" class="c-b">
<div class="footer-inner">
<div id="footer-message">
<div class="footer-inner">
<div id="footer">
© My Company 2012. All Rights Reserved.
<a class="feed-icon" title="Subscribe to www.systrends.com RSS" href="/?q=rss.xml">
</div>
</div>
</div>
</div>
<div id="admin-menu" class="admin-menu-site-sys trends7-sy strends-co m overlay-displace-top admin-menu-processed">
</body>
</html>
Required output
© My Company 2012. All Rights Reserved. (Feed_Icon)
New HTML with current changes:
<html class="js" dir="ltr" version="XHTML+RDFa 1.0" xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<body class="html front logged-in two-sidebars page-node toolbar toolbar-drawer admin-menu" style="padding-top: 30px;">
<div id="skip-link">
<div id="overlay-disable-messag
<div id="toolbar" class="toolbar overlay-displace-top clearfix toolbar-processed">
<div id="header">
<div id="front-page-wrapper">
<div id="page">
<div id="footer" class="c-b">
<div class="footer-inner">
<div id="footer-message">
<div class="footer-inner">
<div id="footer">
© My Company 2012. All Rights Reserved.
<a class="feed-icon" title="Subscribe to www.systrends.com RSS" href="/?q=rss.xml">
</div>
</div>
</div>
</div>
<div id="admin-menu" class="admin-menu-site-sys
</body>
</html>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Does your <a> tag have display: inline; value in css file ?
ASKER
put the <a class="feed-icon"...> onto the same line as the My Company 2012 and check your styling that you are not styling it to be of type block. --- Done
No change
Does your <a> tag have display: inline; value in css file ? ---
not shure what you're asking but I don't think so. Here is the code.
<div id="footer" class="c-b">
<div class="footer-inner">
<?php if ($page['footer']): print render($page['footer']); endif; ?>
<div class="c-b"></div>
</div>
<div id="footer-message">
<div class="footer-inner">
<div id="footer"><?php print "© Systrends 2012. All Rights Reserved. " . $footer_message . $footer ?> <?php print $feed_icons; ?></div>
</div>
</div> <!-- /footer-message -->
</div> <!-- /footer -->
No change
Does your <a> tag have display: inline; value in css file ? ---
not shure what you're asking but I don't think so. Here is the code.
<div id="footer" class="c-b">
<div class="footer-inner">
<?php if ($page['footer']): print render($page['footer']); endif; ?>
<div class="c-b"></div>
</div>
<div id="footer-message">
<div class="footer-inner">
<div id="footer"><?php print "© Systrends 2012. All Rights Reserved. " . $footer_message . $footer ?> <?php print $feed_icons; ?></div>
</div>
</div> <!-- /footer-message -->
</div> <!-- /footer -->
The code
<?php print $feed_icons; ?>
Is the second line, right ?
You have to see what's inside $feed_icons variable and add a styling to it in css file with
display: inline;
Can you please put the code with rss back on page, so we can see it online ?
<?php print $feed_icons; ?>
Is the second line, right ?
You have to see what's inside $feed_icons variable and add a styling to it in css file with
display: inline;
Can you please put the code with rss back on page, so we can see it online ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Took many minds to get what needed to be done pounded into my brain.
Thanks again to everyone.
Thanks again to everyone.
Is it the <div>s you are referring to?