Using Featured Image as Hero Background
Using Featured Image as Hero Background
Using Featured Image as Hero Background
I dont know where you are using/inserting this code, but maybe you need the current post ID. Try using get_the_post_thumbnail_url( <post-ID> ,<thumbnail-size> ); To get the ID of the current post you can for example use $current_id = get_the_ID();. Than you can try $src = get_the_post_thumbnail_url( $current_id ,’post-thumbnail’ ); to get the URL.
An easy solution to crawl your website and find broken links and images on your website is this plugin: https://wordpress.org/plugins/link-checker
Simply edit your themes header.php and place the following snippet between the <head></head> tags to prevent pinning globally. <meta name=”pinterest” content=”nopin” /> Alternatively you can use the Pinterest Block plugin from which offers you more fine-grained control, also for single posts. This plugin allows you to block selected posts and pages from getting pinned on … Read more
Yes, you can choose to regenerate the thumbnails for specific images. You have 2 options. 1- Create a simple plugin Generating thumbnails is done via the wp_generate_attachment_metadata() function, which you can use to generate thumbnails manually. To do so, make a simple plugin that loops through a couple of attachment IDs and generates thumbnail for … Read more
I believe you can fetch that data using setup_postdata() which lets you access all the data relating to a post and use it with standard template tags (in your case, the_post_thumbnail). There is a great tutorial here: https://wpshout.com/setup_postdata-template-tags-need-custom-wp_post-arrays-crave/ Important to note that you first have to setup the global $post and you have to be … Read more
Set featured image using javascript in post editor
Well, images is one of WP’s weak points. First of all – stop uploading full sized images in first place, by that I mean photos from your camera, downloaded/self created artwork, high resolution, MB-heavy Photoshop creations etc.. My personal experience is that people mostly don’t think about image size when uploading stuff to WordPress – … Read more
Attach Thumbnail Generated from Video Upload as Featured Image for the Video
Featured image for product listings, but another image as the product image?