Edit search results for media items.

Homepage Forums Pro Support Forum Blackoot Pro Blackoot Pro Support Edit search results for media items.

Note about WordPress 5.0:
Our themes are compatible with WordPress 5.0. However not all functionality are guaranteed to work as expected with the new editor (Gutenberg) that comes with 5.0.

We highly recommend installing the Classic Editor plugin, which will bring back the usual editor if you run into any issue or just do not like the new editor.

An update to bring full compatibility with Gutenberg is being worked on, but has been postponed because of the recent fast-paced evolution of the Gutenberg project until WP 5.0 release. More info about the release of WordPress 5.0 announced on a short 2-days notice can be found here: New 5.0 Target Date.

Edit search results for media items.

This topic contains 3 replies, has 2 voices, and was last updated by  Michael 2 weeks, 4 days ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24271
    Edit search results for media items.

    Michael
    Participant

    Hey jefe’, I added a plugin to enhance my site’s search results. You helped me center the search results for pages previously. Now, the search results return media items as well as pages and posts. Our comics are served on pages but our horoscopes (blog) is served on posts. The reason we wanted to add media items is so that you could search for horoscopes with similar taxonomy terms like, Gemini or Libra. The problems I’m having are (1) that the media items (jpegs) are smaller than the they appear in the posts, (2) the jpegs are not centered, they’re positioned to the left, and (3) I’d like to remove the titles and descriptions that appear with each media item as well. Thanks as always. You’re a king among men.

    #24274
    Reply to: Edit search results for media items.

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    There you go!

    Add this to Custom CSS:

    body.search-results .type-attachment .entry-title {
        display: none;
    }
    
    body.search-results .type-attachment .postmetadata {
        display: none;
    }
    
    body.search-results .type-attachment p {
        display: none;
    }
    
    body.search-results .type-attachment p.attachment {
        display: flex;
        justify-content: center;
    }
    
    body.search-results .type-attachment p.attachment img {
        max-width: 600px;
        width: 600px;
    }

    And this to Custom Footer code:

    <script type="text/javascript">jQuery( document ).ready(function() {jQuery('body.search-results .type-attachment p.attachment img[sizes]').attr('sizes', '')});</script>

    And it should do the magic. Let me know if it doesn’t and I’ll give it another try.

    #24276
    Reply to: Edit search results for media items.

    Michael
    Participant

    Werrrrrd. Thank you very much. I owe you a beer. Probably more like two at this point. Thanks, as always. Some of the best customer service/support I’ve ever had.

    #24278
    Reply to: Edit search results for media items.

    Michael
    Participant

    Worked perfectly, of course. Many, many thanks.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.


PayPal Verified
Secured by PayPal
Secure Credit Card payments powered by Stripe