0

I'm working with the Bootstrap Child Theme on WordPress. My problem is that I want to remove the entry meta - like posted on date by admin - and also want to change the display of all these posts, but I'm unable to find the right file to edit. I have commented this code in content-single.php but nothing seems to be happening:

<header class="page-header">
    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    <?php /*?><div class="entry-meta"><?php the_bootstrap_posted_on(); ?></div><?php */?><!-- .entry-meta -->
</header>

Here is a link to my category archive: http://graavaa.com/category/travertine/

0

You're on the right track, but you didn't actually comment out anything in your edits.

When you added <?php /* ?>, you're creating a PHP comment just fine, but then closing the PHP tag, which some interpreters will cause to close the comments as well.

Instead, either, wrap the HTML you want eliminated in HTML comments or just delete it entirely:

<header class="page-header">
    <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
    <!--<div class="entry-meta"><?php the_bootstrap_posted_on(); ?></div>--><!-- .entry-meta -->
</header>

By wrapping the markup in an HTML comment, it will still render to the page source, but won't actually be rendered by the browser. Eventually, though, you should still just delete the line so there isn't unnecessary markup sent as output.

Just be careful with HTML comments, because they don't nest:

<!--<div class="entry-meta"><?php the_bootstrap_posted_on(); ?></div><!-- .entry-meta -->-->

The above code looks like it would comment out the entire block, unfortunately the extra --> at the end will be printed as plain text to the browser. Just use comments like this judiciously and, as I already suggested, delete the commented-out lines when you're done testing.

Beyond this, I would look for any other references to class="entry-meta" in other template files within the theme and, similarly, comment them out (or delete them).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.