Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1235118
    Philip M
    Participant

    Hi guys,
    I’m trying to hide the featured image on my Blog page, as some of my posts don’t have a featured image so all you see instead is a massive black square.

    After a lot of digging through here, I have found and tried both of the below, with and without !important, but nether works. Could you help please?

    Many thanks,
    Philip.

    .blog .entry-featured {
    display:none;
    }

    .page.page-id-632 .entry-thumb {
    display: none;
    }

    (632 is my Blog page ID)

    #1235119
    Philip M
    Participant
    This reply has been marked as private.
    #1235474
    Jade
    Moderator

    Hi Philip,4

    Please try this code:

    .page.page-id-632 .x-recent-posts-img {
        padding-bottom: 0 !important;
    }

    Hope this helps.

    #1235716
    Philip M
    Participant

    Hi Jade,
    thank you, that is perfect, just what I wanted.
    Regards,
    Philip.

    PS: I always say “Hi guys”, but that includes gals too! 🙂

    #1235743
    Rad
    Moderator

    You’re so much welcome 🙂

    #1236934
    Philip M
    Participant

    Hi again,
    unfortunately, now that I have added some posts, I had another problem on this same page.
    It is only showing the last 4 posts.
    I have changed Settings>Reading>Blog pages show at most to 10 but that made no difference.

    I really can’t see where else to change this, and how, if required, to add pagination for when I have lots of posts.
    As before, could you enlighten me please?
    Thanks so much.

    #1237272
    Rue Nel
    Moderator

    Hello There,

    By default, recent posts element will display up to 4 items only. If you display more items, you will need two or more recent posts elements stacked each other. You just need to use the offset option so that there will be no duplicate items to display.

    Hope this make sense.

    #1237276
    Rad
    Moderator

    Hi there,

    It will not work. That setting is only applicable for archive pages, eg. the real blog page. Your blog page is just a static page with added recent posts element. And recent posts element is just limited to 4. If you like to utilize that posts count setting, then you have to switch to the standard blog page. You can set that at Admin > Settings > Reading.

    Thanks!

    #1238999
    Philip M
    Participant

    Hi Rue Nel,
    yes, I did consider that, but it would mean constantly adding more and more elements with larger and larger offsets. I didn’t think it was sustainable, plus the page would be really long eventually.
    Thanks.

    Hi Rad,
    I had already tried that, but it then shows the entire posts, including the featured image (which was what I was trying to avoid) regardless of what settings I use in “Full post content on index” and “Excerpt length”.
    Thanks.

    #1239045
    Christian
    Moderator

    Hey Philip,

    Yes, there is no option to disable featured image in Blog out of the box so overriding the featured image function is required. Please add the code below in your child theme’s functions.php

    //* Disable Featured Image in Blog Page
    
    function x_featured_image( $cropped = '' ) {
    
      $stack     = x_get_stack();
      $fullwidth = ( in_array( 'x-full-width-active', get_body_class() ) ) ? true : false;
    
      if ( has_post_thumbnail() ) {
    
        if ( $cropped == 'cropped' ) {
          if ( $fullwidth ) {
            $thumb = get_the_post_thumbnail( NULL, 'entry-cropped-fullwidth', NULL );
          } else {
            $thumb = get_the_post_thumbnail( NULL, 'entry-cropped', NULL );
          }
        } else {
          if ( $fullwidth ) {
            $thumb = get_the_post_thumbnail( NULL, 'entry-fullwidth', NULL );
          } else {
            $thumb = get_the_post_thumbnail( NULL, 'entry', NULL );
          }
        }
    
        switch ( is_singular() ) {
          case true:
            printf( '<div class="entry-thumb">%s</div>', $thumb );
            break;
          case false:
            break;
        }
    
      }
    
    }

    Thanks.

    #1239553
    Philip M
    Participant

    Thank you Christian,

    that does indeed hide the featured image, but the full post content is still showing for every post. Well, except that is for the very first post, which is obeying the 100 word limit I set in the Customiser. Very strange.

    Do you have any idea why this is happening?
    Thanks again,
    Philip.

    #1239664
    Jade
    Moderator

    Hi Philip,

    Would you mind providing your admin access so that we can check your current settings?

    Thank you!

    #1239717
    Philip M
    Participant
    This reply has been marked as private.
    #1240313
    Christopher
    Moderator

    Hi there,

    Please check provided credentials.

    Thanks.

    #1240577
    Philip M
    Participant
    This reply has been marked as private.
  • <script> jQuery(function($){ $("#no-reply-1235118 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>