• I’m trying to remove the entry-header post date from my static front page only, so that SERP don’t display a date for my site’s homepage since it’s not date-specific and meant to be evergreen.

    I tried this Custom CSS:

    .page-id-874  .entry-header .entry-meta {
    	display: none;
    }

    I also tried Date Exclusion SEO plugin but it didn’t work.

    This is the website: Content Writing Services

    Thank you for any help!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I don’t see a date on the home page. Did you resolve this yourself?

    Thread Starter csmarie

    (@csmarie)

    No, not resolved yet (cute cat!). The date doesn’t appear on that page visually, but it’s in the source code:

    <header class="entry-header">
    
    		<span class="date updated published">September 29, 2016</span>
    		<span class="vcard author byline"><a href="https://www.constancematic.com/author/admin/" class="fn">admin</a></span>
    
    		<h1 class="entry-title" itemprop="headline">Content Writing Services I Website Copywriting</h1>
    	</header>

    Search engine bots are picking it up and displaying it on search engine results pages before the page description.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You could add

    
    if ( is_home_page() || is_front_page() ) {
     } else {
    
    then that code
    
    }

    to keep it from outputting it at all when on the front of your site.

    Thread Starter csmarie

    (@csmarie)

    Thanks, Steve. It looks like that would address the problem but I’m not versed in conditional CSS. Would I put that in Custom CSS or directly edit certain php files in the Child Theme? Could you explain what you mean by “then that code?” Thank you!

    Thread Starter csmarie

    (@csmarie)

    I believe I found the relevant section in content-single.php:

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    
    	<header class="entry-header">
    
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    
    		<div class="entry-meta">
    
    			<?php zerif_posted_on(); ?>
    
    		</div><!-- .entry-meta -->
    
    	</header><!-- .entry-header -->
    

    I’d like to be able to either A) specify which pages to leave the entry header out of or B) leave it off all pages and only have it appear for posts. Is that possible?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    You’d use a conditional test: See https://codex.www.ads-software.com/Conditional_Tags for the list. You should be working in a child theme rather than directly modifying your theme’s code.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Remove Entry Header Date for Static Front Page Only’ is closed to new replies.