WordPress.org

Support

Support » How-To and Troubleshooting » How to remove category name from post title?

How to remove category name from post title?

  • On the main blog page, I don’t want the category to be listed before the post title. My index.php has the following code, does this part contain the category stuff I need to edit? Or is it elsewhere? I don’t want to just start deleting things as I have a tendency to break sites 🙂

    GrenadeGearUSA.com

    <?php if (have_posts()) : ?>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><span><?php the_category(', ') ?> </span> → <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    @alchymyth

    Forum Moderator

    try and remove this section from your code:

    <span><?php the_category(', ') ?> </span> →

    Perfect. Thanks. I also had to include the &rarr as that was the arrow. I just made the code into a comment for future reference.
    <!-- <span><?php the_category(', ') ?> </span> &rarr; -->

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to remove category name from post title?’ is closed to new replies.
Skip to toolbar