Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Displaying HTML code on pages
#9
eatons Wrote:
Angryboy Wrote:
eatons Wrote:Have you tried pasting your code straight into the WYSIWYG editor?
Works for me!
http://eatons.net/tutorials/innnovationoutline/
I've tried this now that you've asked. My source code in the WYSIWYG editor is this:

Code:
<pre>
    &lt;?php
    ...

    ?&gt;</pre>

When viewed on the actual page, the source code becomes this:

Code:
<pre>    <!--?php

    ...

    ?--></pre>

Making it unviewable. Thanks for offering some help to me regardless :-)

I set up a test page at: http://eatons.net/tutorials/test/
Is either of these what you're looking for?
The top one is Smile

I think I've found the problem, and it might be a bug with the way that Special Pages processes page content. I copied the HTML code from your page onto a test normal page and it displays fine:

http://spritingonawhim.net.tc/testpage/

But that very same content on a special page:

http://spritingonawhim.net.tc/testpage2/

And it processes the <?php as thought it were an actual command. The use of
<?php get_page_content(); ?>
in a Special Page's template doesn't output the content in the same way that it does for normal pages.

Thanks for your contribution, eatons!

--------------------

Found my solution!

Code:
<?php get_special_field('content', $default='', $isHTML=false); ?>

Instead of the usual get_page_content, because the default for that is to encode the characters < and > for special fields. Sorry for the trouble caused people!

Note for mvleck: you may want to make that clear on the Special Pages information you've got so that others don't make my silly mistake either!
Reply


Messages In This Thread
Displaying HTML code on pages - by Angryboy - 2012-04-03, 18:52:54
Displaying HTML code on pages - by mvlcek - 2012-04-03, 19:09:59
Displaying HTML code on pages - by marrco - 2012-04-03, 19:42:18
Displaying HTML code on pages - by Angryboy - 2012-04-03, 20:11:25
Displaying HTML code on pages - by mvlcek - 2012-04-03, 20:48:56
Displaying HTML code on pages - by eatons - 2012-04-04, 06:39:35
Displaying HTML code on pages - by Angryboy - 2012-04-04, 17:08:44
Displaying HTML code on pages - by eatons - 2012-04-04, 20:32:05
Displaying HTML code on pages - by Angryboy - 2012-04-04, 21:07:46



Users browsing this thread: 1 Guest(s)