Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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, 01: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 02:06 PM.
  #2  
Old Sep 4, 2010, 02:24 PM
juggledad's Avatar
juggledad
 
23,765 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, 04: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



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 11:51 AM
php in footer.php - links to just show up on homepage chris Atahualpa 3 Wordpress theme 6 May 9, 2010 12:50 PM
PHP goodies for kicker/footer? paulae Post-Kicker, -Byline & -Footer 5 Oct 14, 2009 08:13 AM
[SOLVED] messed up header.php and footer.php monochrome Header configuration & styling 0 Jun 20, 2009 02:16 PM


All times are GMT -6. The time now is 04:37 PM.


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