WordPress.org

Ready to get started?Download WordPress

Forums

Disable all HTML in the posts (8 posts)

  1. chuck_d
    Member
    Posted 8 years ago #

    I wish to stop all HTML in posts.

    Can anyone tell me how exactly to do it? Using strip_tags or any other way.

    Thanks in advance.

  2. katie1
    Member
    Posted 8 years ago #

    Just out of curiosity, why do you want to disable HTML tags?

    And which tags do you want to disable?

  3. chuck_d
    Member
    Posted 8 years ago #

    I wish to stop all HTML in posts.

  4. Beel
    Member
    Posted 8 years ago #

    'prolly haven't gotten a response 'cuz you virtually answered your own question...

    <?php echo strip_tags(get_the_content()); ?>

  5. chuck_d
    Member
    Posted 8 years ago #

    I really appreciate you replying with code as I am a PHP dummy ;-).

    Ho do I edit this index.php code from my template or do I put your code somewhere else?

    <?php $custom_fields = get_post_custom(); //custom fields ?>

    <?php if (isset($custom_fields["BX_post_type"]) && $custom_fields["BX_post_type"][0] == "mini") { ?>

    <hr class="low" />

    <div class="minientry">

    <?php echo BX_remove_p($post->post_content); ?>
    <?php comments_popup_link('(0)', '(1)', '(%)', 'commentlink', ''); ?>
    " class="permalink" title="Permalink"><?php the_time('M j, \'y') ?><!--, <?php the_time('h:ia') ?>-->
    <!--<em class="author"><?php the_author() ?>-->
    <?php edit_post_link('Edit','<span class="editlink">','</span>'); ?>

    </div>

    Thanks again.

  6. Beel
    Member
    Posted 8 years ago #

    Looks like you are already using a function to remove p tags. Replace that line. Be forewarned, if it works, the output will be completely unformatted and will probably look like one long run-on paragraph.

  7. chuck_d
    Member
    Posted 8 years ago #

    Thanks Beel. Sorted it.

  8. chuck_d
    Member
    Posted 8 years ago #

    Thanks Beel. Sorted it.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags