WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Remove Links from Post Titles (4 posts)

  1. johnnycho
    Member
    Posted 1 year ago #

    Can anyone tell me how to remove the link from a post title so that only the title shows up? I don't want to do this for ALL post titles -- just the ones in a particular category that show up on a particular page. I've created a custom page template in a child theme. Is there some way to do a conditional statement in my custom page template that modifies the output of the_content() to strip out the link tags? Thank you.

  2. Tara
    Member
    Posted 1 year ago #

    In your theme's php files there should be a reference to these permalinks, looking like this:

    <a href="<?php the_permalink(); ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a>

    Remove the anchor links and replace it with:

    <?php the_title(); ?>

  3. johnnycho
    Member
    Posted 1 year ago #

    Thanks t-p! It helps to base one's custom solution on the correct template!

    Still new to WP. So much to learn...!

  4. Tara
    Member
    Posted 1 year ago #

    you are welcome.:-)

Topic Closed

This topic has been closed to new replies.

About this Topic