Support » Fixing WordPress » Help implementing html code into page

  • Im trying to put this code on a wordpress page but it just shows up blank. There isnt anything wrong in the code, becuase it works fine when the code is on a html page. Any help with telling me why it wont show up, or another way to display this html correctly without haveing to link to another source(ex. iframe). Thanks in advance

    <div style="width:650px; height:370px;">
    <style type="text/css">
    body,html {padding: 0px; margin: 0px; background: #000; font-family: Arial, Tahoma, Helvetica; color: #fff; font-size: 14px;}
    #flowplayer {text-align: center; width: 650px; height: 370px;}
    <script type="text/javascript" src=""></script>
    <script type="text/javascript" src=""></script>
    <div id="flowplayer"></div>
    <div id="ret"></div>
    <script type="text/javascript">
    $(function() {
    							$f("flowplayer", {src: "", wmode: 'transparent'},  {
    								canvas: {
    									backgroundColor: 'transparent',
    									backgroundGradient: 'none'
    								showErrors: false,
    								onError: function(errorCode){
    									if(errorCode == 303) {
    								contextMenu: ["AUEngine"],
    								key: "#$b74d0ff1ab664c44d8c",
    									controls: {
    										url: "",
    										zIndex: 3,
    										backgroundColor: "rgba(0,0,0,0.5)",
    										backgroundGradient: "none",
    										height: 37,
    										volumeColor: "#0066ff",
    										hideStyle: "move",
    										timeColor: "#ffffff",
    										durationColor: "#0066ff",
    										bufferColor: "#222222",
    										progressColor: "#0066ff",
    										buttonOverColor: "#eeeeee"
    									lighttpd: {
    												url: '',
    												queryString: escape('&start=${start}')
    									yume: {
    										url: '',
    										yume_library_swf_url: '',
    										yume_preroll_playlist: '',
    										yume_midroll_playlist: '',
    										yume_postroll_playlist: '',
    										yume_branding_playlist: '',
    										support_preroll: 'true',
    										support_leader: 'true',
    										support_midroll: 'true',
    										support_postroll: 'true',
    										support_branding: 'true',
    										support_watermark: 'true',
    										preAsMid: 'true',
    										preAsPost: 'true',
    										controlsHeight: '37',
    										normalscreen_x: '0',
    										normalscreen_y: '0',
    										normalscreen_width: '640',
    										normalscreen_height: '360',
    										zIndex: 2
    												url: '',
    												scaling: 'fit'
    												url: '',
    												autoPlay: false,
    												scaling: 'fit',
    												autoBuffering: false,
    												provider: 'lighttpd'
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-24380888-1']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    <img src="" width="1px" height="1px" alt="" />
Viewing 2 replies - 1 through 2 (of 2 total)
  • The WordPress post/page editor strips away PHP and JavaScript for security reasons, because that content is stored in your MySQL database and allowing it would make you vulnerable to SQL injections.

    If you need to add JavaScript or PHP, consider creating a separate PHP file (ex: custom.php) in your theme folder. Put the above code in that file, then add this to your functions.php file:

    function my_custom_template_part( $atts ) {
        get_template_part( 'custom' );
        return ob_get_clean();
    add_shortcode( 'custom', 'my_custom_template_part' );

    Finally, use the shortcode [custom] in your post or page to display the template part.

    You could make that shortcode function more versatile by accepting template $slug and $name parameters, like this:

    function my_custom_template_part( $atts ) {
        $slug = isset( $atts['slug'] ) ? $atts['slug'] : 'custom';
        $name = isset( $atts['name'] ) ? $atts['name'] : null;
        get_template_part( $slug, $name );
        return ob_get_clean();
    add_shortcode( 'custom', 'my_custom_template_part' );

    That would allow you to use a shortcode like [custom slug=foo name=bar], which would first look for a file called foo-bar.php in your theme folder, then fall back on foo.php if foo-bar.php is not found.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help implementing html code into page’ is closed to new replies.