How to not show featured image in posts

Hi,

I’ve X-theme.

I don’t want to show the post title and the post featured image. How can i do that through php in the child theme?

Hello @marcdb,

Thanks for reaching out. :slight_smile:

You can make the changes using CSS. Please add following CSS under X > Theme Options > CSS:

.single-post .entry-featured {
    display: none;
}

.single-post .entry-title {
    display: none;
}

1- I have found the proper CSS code selector using the Chrome browser Developer Toolbar: https://www.youtube.com/watch?v=wcFnnxfA70g

2- For the CSS code itself, I suggest that you get started with this tutorial: https://www.youtube.com/watch?v=yfoY53QXEnI

Thanks.

Yes, but if you look at the coding of the page, the header is still there, but made invisible.

I want to get rid off the code itself. So how can i delete this code in an php file?

Club 12 120 XXL

Club12120XXL Bodenschrank

Hello @marcdb,

To resolve your issue, assuming that you have your child theme active and ready, please follow these steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/{STACK}/_CONTENT-POST-HEADER.PHP
// -----------------------------------------------------------------------------
// Standard <header> output for various posts.
// =============================================================================


// No Header to Display Here!!!!

?>

3] Save the file named as _content-post-header,php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/views/{stack}/.

You will need to create the folder path since it does not exist in your child theme yet. And by the way, please make sure that you replace {stack} with the correct stack (ethos, integrity, renew or icon) that your are using.

We would loved to know if this has work for you. Thank you.

Thanks a lot, works just fine :slight_smile:

Glad to hear that. :slight_smile:

There is still an issue that causes pages with featured image to show some xtra code than pages that doesnt have them.
In both cases i dont see the image, so thats good, But the spacing between Section 1 and the header is different.

So I checked the coding, this is the code that causes the extra spacing. It shows up on the pages that have a featured image installed. How can get rid of this code too?

<header class="x-header-landmark">
  <div class="x-container max width">
    <div class="x-landmark-breadcrumbs-wrap">
      <div class="x-landmark">

      
       

      
      </div>

      
      
    </div>
  </div>
</header>

Hi @marcdb,

Thanks for reaching out.

It’s the landmark, it’s either hide it through CSS, or remove the code and it’s related to the file \framework\legacy\cranium\headers\views\{STACK}\_landmark-header.php and you can remove it there. Just follow the same instruction provided by Ruenel.

Thanks!

Ok thanks, that worked for me !

You’re welcome!
Thanks for letting us know that it has worked for you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.