• Hello,
    I’m not sure if I’m understanding how to use the new setting of the cover block to pull in the Featured Image.
    My theme displays the featured image above post as first item, even above the title.
    Is it possible to replace the Featured image by the Cover block with featured image setting on (pulled in), and not getting two of the same images in the post?
    And by replacing I mean that it would take the same spot in the post, above post-title.
    I feel so stupid I can’t find a thread which explains this.
    Theme author is not available because it was removed from codecanyon.

    • This topic was modified 2 years, 7 months ago by BlackBoXz.
    • This topic was modified 2 years, 7 months ago by BlackBoXz.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s possible. The solution depends on where you want the cover block to appear. If you still want the cover block within post/page content, should it appear there automatically or would you still manually insert it?

    If you manually insert it into content, you merely need to alter the theme template code to suppress featured image output. Most themes use a conditional statement to output the image HTML only if a featured image is specified. You could alter the conditional so that it always evaluates as false no matter what.

    If you want a cover block to occur automatically, how would the template code know what text to use in the block? Use the post/page title? If so, instead of an actual cover block, alter the HTML output of the existing title and featured image to be similar to that of a cover block, but it’s not an actual block because it’s independent of post/page content. You’ll also need some custom CSS to get the title to appear within the featured image instead of below.

    Thread Starter BlackBoXz

    (@blackboxz)

    Hello thanks for responding,

    What I want is replacing my Featured Image, that’s automatically placed above post title in my theme, by the cover block with this Featured image pulled in so I’ll get all the benefits from this cover block and have an Featured Image also. If this is done autom. or man. doesn’t matter.
    But how to get a cover block above post title manually?

    What I don’t want is two same images in the post.I can’t hide the featured image, not that I know off. (And if there’s a way to do it, will cover block still find it?)

    So I understand it’s not that easy what I want.Please keep in mind that I’m not a die-hard coder but more a copy&paste guy ??

    I’m asking myself infact why this new setting of the cover block is designed like this,with in mind that most theme’s display the Featured Image autom.in the post also.
    This setting needs some tweaking as far as I am concerned.

    Greetings,

    • This reply was modified 2 years, 7 months ago by BlackBoXz.
    Moderator bcworkz

    (@bcworkz)

    Maybe more theme’s need a option to display a featured image or not, regardless of whether it’s defined or not ??

    Doesn’t solve your immediate issue of having the image twice. I don’t know how the featured image option actually works. I pretty confident though that you can hide the current above title image with CSS and the cover block can still find the correct image. Hiding with CSS isn’t ideal, but not too bad since the image will be utilized elsewhere anyway. It’d be better if you can identify the template code responsible and some how disable it. For example, turn all the responsible lines into PHP comments by delimiting with /* */ symbols. The code is then easily restored if need be.

    So the cover text wouldn’t be the post title then? Getting a cover block to appear on a page that is not a post content area by manipulating template PHP could get rather involved. One alternative that could work, depending on your theme, is to use CSS’ flex box model to rearrange the order elements appear on the page. But the typical HTML hierarchy we typically see from plugins themes probably isn’t conducive to this approach.

    Maybe another possibility is by making the area above the title a new widget area. I’m unsure how a featured image cover block would behave in that context. Will it still pull the current post’s featured image that way? Do a test with a cover block in an existing widget area or sidebar to see if the featured image option still works there.

    • This reply was modified 2 years, 7 months ago by bcworkz.
    Thread Starter BlackBoXz

    (@blackboxz)

    Thank you for your response and think with me.

    Because what I want is not that simple to create for me I’ll wait till I have a new theme installed with FSE. My theme author walked away on codecanyon so I’m forced to replace it after a while.
    I think the cover block is designed this way because they had a FSE theme in mind where this makes more sense I guess.

    Greetings,

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Replace Featured Image by Cover block?’ is closed to new replies.