Tagged: x
-
AuthorPosts
-
November 6, 2016 at 1:29 pm #1246134
lexidevParticipantIs it possible to assign a featured image globally (via code or css) for all posts that have no specific featured image assigned? It should be possible to replace that global default image by using the insert featured image dialog in each individual post. This would look great in a site where there are over 1000 legacy articles without images.
Can it be done?November 6, 2016 at 9:10 pm #1246462
RadModeratorHi there,
Thanks for writing.
As fall back background, yes possible. But to insert images automatically isn’t possible with CSS.
Would you mind providing your site’s URL that has this post with no featured image? It can be done through .no-post-thumbnail but I’m not sure how it should be displayed. (eg. top the headline, below the headline, as masonry, and etc.)
Thanks!
November 7, 2016 at 12:22 pm #1247479
lexidevParticipantThis reply has been marked as private.November 7, 2016 at 4:27 pm #1247747
FriechModeratorHi There,
You can add this under Custom > Global JavaScript in the Customizer.
jQuery( document ).ready(function() { jQuery('<div class="entry-thumb"><img width="100%" src="IMAGE URL HERE" class="img-defaultfeatured" alt="feature image"></div>').insertBefore(".no-post-thumbnail .entry-featured"); });Replace the IMAGE URL HERE string with your actual image URL.
Thanks.
November 7, 2016 at 6:06 pm #1247832
lexidevParticipantThank you so much, Friech. This works exactly as I wished it would. You can replace the default with another image and it displays as it should. Am thrilled.
November 7, 2016 at 6:26 pm #1247843
NicoModeratorHappy to hear that.
Feel free to ask us again.
Thanks.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1246134 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
