WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove Tags from the_content output (7 posts)

  1. moonwizard
    Member
    Posted 4 years ago #

    Hello!

    I'm using a theme which uses the the_content() function to show the content of pages.

    This line of code also shows me the page tags.

    Can I remove or hide the tags from the the_content output?

    Thank you!

  2. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    the tags are likely displayed using 'the_tags()'
    http://codex.wordpress.org/Template_Tags/the_tags
    find this in your code and delete it.

    always make a backup copy before editing theme files

  3. esmi
    Forum Moderator
    Posted 4 years ago #

    Try using the PHP strip-tags() function.

  4. moonwizard
    Member
    Posted 4 years ago #

    Hello,

    Sorry I think I haven't explained myself clearly.

    I can see clearly that at the end of my page the tags are shown because when I comment out the the_content() line, both tags are content are not showed anymore.

    This is the code in my "page.php":

    <div class="post" id="post-<?php the_ID(); ?>">
                            <h1 class="title"><?php the_title(); ?></h1>
                            <?php post_slide_show(); ?>
                            <?php the_content(); ?>
                            <?php wp_link_pages(array('before' => '<p>Pages: ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
    
                            <div class="clear"></div>
    						<?php edit_post_link(__('Editar aquesta entrada'), '<p>', '</p>'); ?>
                        </div>

    I don't see the the_tags function anywhere.

    Am I completely lost?

    Thank you!!

  5. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    a link to your page might help.

  6. moonwizard
    Member
    Posted 4 years ago #

    Here you have an example:

    http://bit.ly/beomfy

    As you can see, at the end of the content, the tags are shown. I want to hide tags. They confuse the visitor.

    Your help is really appreciated. Thank you!

  7. moonwizard
    Member
    Posted 4 years ago #

    Hello,

    Now the tags are gone. This was due to Headspace plugin, which was publishing the tags inside the main content.

    The solution is really easy, although it has taken me some days to notice it: just deactivate the option "Force tags in posts" and "Force tags in pages" and that's all.

    Hope it helps somebody anytime. Thank you for your help.

Topic Closed

This topic has been closed to new replies.

About this Topic