Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Removing category and comments links from blog posts (Wordpress)

Featured Replies

The trouble with looking at the code is php wont show up with view source.

 

However - I had a look at the source and you need to look for a div tag with the class of post-header so:

 

 

<div class='post-header'>

</div>
 

 

Inside that were will probably be calls to the_category and comments_number like:

<div class='post-header'>


*** Look for these functions below ***

<?php the_category(); ?>
<?php comments_number(); ?>



</div>
  

 

Remove those functions.

 

I assume its in the standard post type but i cant be certain. if you dont have specific post type files then look in your index.php file.

 

good luck :)

 

ps this stuff is easier to find with something like chrome dev tools - when you hover over the code, the corresponding point on the page is highlighted.

Edited by Mr Ben

  • Author

Do you know how I also remove this from the general blog page?

It has been removed form posts.. But not the main blog page!

The same code that Ben noted will probably appear somewhere in index.php

 

<?php the_category(); ?>
<?php comments_number(); ?>

 

If it is in index.php, remove them.

A

 

The same code that Ben noted will probably appear somewhere in index.php

 

<?php the_category(); ?>
<?php comments_number(); ?>

 

If it is in index.php, remove them.

 

 

Do you know how I also remove this from the general blog page?

It has been removed form posts.. But not the main blog page!

 

 

Ah yes, sorry I forgot about single.php - Wordpress will display all blog posts excerpts in the index.php file and the single.php will show the entire blog post. Its the same functions that you are looking for in index.php and single.php.

 

Thanks for the best answer vote :)

  • Author

A

 

 

 

 

 

Ah yes, sorry I forgot about single.php - Wordpress will display all blog posts excerpts in the index.php file and the single.php will show the entire blog post. Its the same functions that you are looking for in index.php and single.php.

 

Thanks for the best answer vote :)

 

Hmm.... It doesn't seem to be in my index.php:

<?php get_header(); ?>

<?php nectar_page_header(get_option('page_for_posts')); ?>

<div class="container-wrap">
		
	<div class="container main-content">
		
<?php if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('<p id="breadcrumbs">','</p>');
} ?>

		<?php if(!is_home()) { ?>
			<div class="row">
				<div class="col span_12 section-title blog-title">
					<h1><?php wp_title("",true); ?></h1>
				</div>
			</div>
		<?php } ?>
		
		<div class="row">
			
			<?php $options = get_option('salient'); 
			
			$blog_type = $options['blog_type'];
			if($blog_type == null) $blog_type = 'std-blog-sidebar';
			
			$masonry_class = null;
			
			//enqueue masonry script if selected
			if($blog_type == 'masonry-blog-sidebar' || $blog_type == 'masonry-blog-fullwidth') {
				wp_enqueue_script('blogmasonry');
				$masonry_class = 'masonry';
			}
			
			if($blog_type == 'std-blog-sidebar' || $blog_type == 'masonry-blog-sidebar'){
				echo '<div id="post-area" class="col span_9 '.$masonry_class.'">';
			} else {
				echo '<div id="post-area" class="col span_12 col_last '.$masonry_class.'">';
			}
	
				if(have_posts()) : while(have_posts()) : the_post(); ?>
					
					<?php 
					$wp_version = floatval(get_bloginfo('version'));
		
					if ( $wp_version < "3.6" ) {
						//old post formats before they got built into the core
						 get_template_part( 'includes/post-templates-pre-3-6/entry', get_post_format() ); 
					} else {
						//WP 3.6+ post formats
						 get_template_part( 'includes/post-templates/entry', get_post_format() ); 
					} ?>
	
				<?php endwhile; endif; ?>
				
				<?php nectar_pagination(); ?>
				
			</div><!--/span_9-->
			
			<?php  if($blog_type == 'std-blog-sidebar' || $blog_type == 'masonry-blog-sidebar') { ?>
				<div id="sidebar" class="col span_3 col_last">
					<?php get_sidebar(); ?>
				</div><!--/span_3-->
			<?php } ?>
			
		</div><!--/row-->
		
	</div><!--/container-->

</div><!--/container-wrap-->
	
<?php get_footer(); ?>

.. Any ideas?

This may not be a completely ideal solution but it should work.

 

Does your theme (Salient) have a 'Custom CSS' option somewhere in the Theme Options? Basically a place where you can input Custom CSS which will automatically overwrite any CSS from the files. This will be simpler because Themeforest themes come with tons of different CSS files and otherwise it will be a search to find this class.

 

If you have a Custom CSS option, insert this code:

 

.meta-category {
    display: none;
}

.meta-comments-count {
    display: none;
}
  • Author

 

This may not be a completely ideal solution but it should work.

 

Does your theme (Salient) have a 'Custom CSS' option somewhere in the Theme Options? Basically a place where you can input Custom CSS which will automatically overwrite any CSS from the files. This will be simpler because Themeforest themes come with tons of different CSS files and otherwise it will be a search to find this class.

 

If you have a Custom CSS option, insert this code:

 

.meta-category {
    display: none;
}

.meta-comments-count {
    display: none;
}

 

It does.. I inserted the code, but nothing has happened..

 

lRHkYTu.png

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.