Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Post-Kicker, -Byline & -Footer »

Footer php wierdness


  #1  
Old Sep 4, 2010, 02:55 PM
Kadin
 
39 posts · May 2010
I was trying to execute some php code and it kept screwing up so I pasted some test code into the ATO -> Edit POST/PAGE -> Footer: homepage

Quote:
<?php
$text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";

// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
?>
This should spit something out like:

Quote:
Test paragraph. Other text
<p>Test paragraph.</p> <a href="#fragment">Other text</a>
But instead I get:

Quote:
Other text'; echo strip_tags($text); echo "\n"; // Allow
and echo strip_tags($text, '

'); ?>
Any clues?

P.S. Almost forgot to link the site. If you want to take a peek it is www.pvpgamer.com
I disabled all the plugins and it did not fix the problem.

Last edited by Kadin; Sep 4, 2010 at 03:06 PM.
  #2  
Old Sep 4, 2010, 03:24 PM
juggledad's Avatar
juggledad
 
23,682 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
change it to
HTML Code:
<?php $text = '<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>';
echo strip_tags($text);
echo "\n";

// Allow <p> and <a>
echo strip_tags($text, '<p><a>');
?>
note you will not see
HTML Code:
<p>Test paragraph.</p> <a href="#fragment">Other text</a>
unless you look at the source because it is html and when you view the page, the html gets processed so you will see
HTML Code:
Test paragraph. Other text
Test paragraph.

Other text
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Sep 4, 2010, 05:13 PM
Kadin
 
39 posts · May 2010
So the carriage return killed it. This is why I don't code for a living lol.

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pls help me change this code<title><?php bloginfo('name'); ?><?php wp_title(); ?></ti tobywinn Header configuration & styling 1 Nov 18, 2011 12:51 PM
php in footer.php - links to just show up on homepage chris Atahualpa 3 Wordpress theme 6 May 9, 2010 01:50 PM
PHP goodies for kicker/footer? paulae Post-Kicker, -Byline & -Footer 5 Oct 14, 2009 09:13 AM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 03:16 PM


All times are GMT -6. The time now is 05:02 AM.


Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.