WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] When apply the PRE html tag to some line of code, STYLE tag vanishes from post

[Resolved] When apply the PRE html tag to some line of code, STYLE tag vanishes from post

  • Hi,

    When I apply the PRE html tag to some line of code, STYLE tag vanishes from post.

    I want to add code (contains php and html) to my posts.
    I heard I have to use the PRE html tag to do this, on some code it works, but the STYLE html tag vanishes and breaks my code.

    Here is the code I want to put in the PRE tag :

    <?php if (is_single()) {
        $css = get_post_meta($post->ID, 'css', true);
        if (!empty($css)) { ?>
            <style type="text/css">
            <?php echo $css; ?>
            </style>
        <?php }
    } ?>

    I want the same effect/appearance than above.
    How can I allow my WordPress to accept STYLE html tag in the PRE tag ?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] When apply the PRE html tag to some line of code, STYLE tag vanishes from post’ is closed to new replies.
Skip to toolbar