Topic Resolution: Resolved
  • Closed
  • June 12, 2015 at 11:39 am #18234

    Hi, I enanbled featured Images in Theme Options –> Blog. When the result of a search find a page without an image, the featured image frame is empty (of cource) in the search result. Is there a possibility to hide this “empty frame” in search result when no Image was found?

    Thank you, Frank

    Example: http://nupsoft.com/en/solutions/ –> use search (sitebar on the right) –> type in i. e. jennifer (first match)

    Imran
    Spectator
    Posts: 403
    June 12, 2015 at 12:23 pm #18235

    Hi Frank,

    Thanks for writing in,

    To achieve this you can add following code under Appearance > Theme Options > Custom CSS:

    .hentry:not(.has-post-thumbnail) .thumbnail-post {
    display: none;
    }

    Thanks.

    Frank Stellmacher
    Spectator
    Posts: 18
    June 12, 2015 at 12:44 pm #18236

    Hi Imran,
    thanks for your answer. My Problem here is, I have 84 pages with Images on it, but none of them have defined a “featured Image”, because I do not want to show it on the page.
    Without your css it seems, that the search result just take an image out of the page content and view it in the search result as a featured Image…that is fine and exactly want i want.

    But I have a few pages without any Image and as I said, I do not want to define a featured Image in “edit page Options”, because i do not want it on the page itself.

    If there is no way to do so, maybe there is a work around: Can I defined for all pages a featured Image under page edit Option, and is there a code to hide it then on each page (….display: none;)???

    Thank you!

    Frank Stellmacher
    Spectator
    Posts: 18
    June 13, 2015 at 8:43 am #18244

    Hi Imran,

    here are the results (each page does not has a featured Image, just 2 posts have):
    Without your code : http://nupsoft.com/?s=jennifer
    With your code: http://nupsoft.com/en?s=jennifer

    Maybe their is a chanche to do something in the search.php of my child theme?

    Imran
    Spectator
    Posts: 403
    June 15, 2015 at 9:07 am #18256

    Hi Frank,

    You can simply add the featured images to your pages and then add this CSS code to hide the featured image only from the single pages. Please add the following code under Appearance > Theme Options > Custom CSS:

    body.page .thumbnail-post {
    display: none;
    }

    Thanks.

    Frank Stellmacher
    Spectator
    Posts: 18
    June 15, 2015 at 11:47 am #18260

    Hi Imran, perfect…with this solution I can decide myself, which image should be shown in the search results!

    Thanks for your help and best regards, Frank

    Imran
    Spectator
    Posts: 403
    June 16, 2015 at 10:31 am #18281

    You’re welcome Frank! 🙂