WordPress.org

Ready to get started?Download WordPress

Forums

striping html from the_content (4 posts)

  1. vanner
    Member
    Posted 8 years ago #

    I'm implementing Yahoo search on my site with Y!Q but have an issue striping HTML tags from the_content().

    Anyone know how I can use strip_tags()
    to strip HTML from: the_content()

    This is my code:


    <div class="entry">

    <h2>" title="Permalink"><?php the_title(); ?></h2>

    <?php ($post->post_excerpt != "")? the_excerpt() : the_content(); ?>

    <form class="yq" action="http://yq.search.yahoo.com/search" method="post">
    <input type="hidden" name="context" value="<?php the_content();?>">
    <div class="yqact">
    <input type="hidden" name="fr" value="yqm01">
    <input class="yqbt" type="submit" value="Find Related Links" onclick="return activateYQ(this)" />
    </div>
    </form>

    <p class="info"><?php if ($post->post_excerpt != "") { ?>" class="more">Continue Reading<?php } ?>
    <?php comments_popup_link('Add comment', '1 comment', '% comments', 'commentlink', ''); ?>
    <em class="date"><?php the_time('F jS, Y') ?> at <?php the_time('h:ia') ?>
    <em class="author"><?php the_author();?></e>

  2. vanner
    Member
    Posted 8 years ago #

    basically, i need to parse the_content()

    to make it the value here:

    <input type="hidden" name="context" value="<?php the_content();?>">

  3. Beel
    Member
    Posted 8 years ago #

  4. vanner
    Member
    Posted 8 years ago #

    thanks! that worked!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.