• Resolved spungedave

    (@spungedave)


    Hi ThemeGrill,

    I hope you can advise me what I’m doing wrong. I wish to place a Blog Widget on my homepage for a select Category, but suppressing the featured image display. Due to previous design decisions, the image for category Cigar Analyses does not display well in the widget, so I want to hide it – but ONLY for this category. Here is what I have done:

    – Copied file content-widget-blog.php from the /flash-toolkit/templates directory to my customtheme/flash-toolkit directory

    – Changed one line of code:
    FROM –> if( ! has_post_thumbnail() ) {
    $post_image = ‘image-none’;
    TO –> if( (! has_post_thumbnail() ) || ($category = ‘Cigar Analyses’) ){
    $post_image = ‘image-none’;

    Unfortunately this is not working. In fact I cannot tell if my override of the theme’s default content-widget-blog.php is happening at all. Perhaps I’m going about this all wrong and there’s an easier way to suppress the featured image display based on the Category?

    Any advice would be greatly appreciated.

    • This topic was modified 4 years, 4 months ago by spungedave.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter spungedave

    (@spungedave)

    Never mind this request – I figured it out already!

    Hi @spungedave
    It seems you’ve already resolved it, please let us know if there is any query regarding our theme.
    Thank You.

    Thread Starter spungedave

    (@spungedave)

    Thanks Namrata, I did solve the problem with the widget, but I now find I need to make a similar change in a different place. To review, my need is to suppress the display of the featured image for a certain category of posts (called Cigar Analyses). I succeeded with this in the case of the widget, by copying the file content-widget-blog.php from the /flash-toolkit/templates directory to my customtheme/flash-toolkit directory, then altering the code to detect the category and suppress the image display.

    Now I need to do the same thing for the Related Posts display that appears at the bottom of the post, before the comment block. My question is can I override the standard related-posts.php with a customized version in my child theme? If so where should I place the customized version of this file?

    Thanks again for any advice…

    David

    Hi @spungedave
    It is hard for us to provide you with code unless we know which code you previously have added. Please try copying related-post.php with the same folder structure and modify the code from the line: 15 – 21.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Customizing FT:Blog Widget’ is closed to new replies.