Post thumbnail not displaying in correct position
You are using the_post_thumbnail, which directly outputs the thumbnail in an image tag. You need to use get_the_post_thumbnail instead, which returns the image.
You are using the_post_thumbnail, which directly outputs the thumbnail in an image tag. You need to use get_the_post_thumbnail instead, which returns the image.
Here is the example inside a loop. Maybe yours looks a little different but essentially where you find have->posts() you’ll see a loop. In this block I just created a div and set the style to use the featured image as the background. // WP_Query arguments $args = array ( ‘numberposts’ => -1 ); // … Read more
If your theme allow you to edit the text displayed on your home page, when you just need to add a a link. A click to call link is a simple HTML link, except that the value of the href attribute needs to refer to the “tel” protocol: <a href=”https://wordpress.stackexchange.com/questions/278772/tel:XXXXXXXXXXXXX”>Call Us</a> Where “XXXXXXXXXXXXX” is your … Read more
The featured image is just an attachment, and you can retrieve its post ID via get_post_thumbnail_id, e.g. $featured_image_id = get_post_thumbnail_id( $post ); At which point you’re dealing with a standard post of type attachment. Other than checking that there is a featured image, no special handling is needed and it can be treated as any … Read more
DPI (as saved in image metadata) does not really apply to displays since pixel density is property of hardware. You can fake this by resizing image with smaller dimensions in HTML, but saving with higher JPEG compression might make more sense. Default compression level WP uses is 90 (out of 100) and it can be … Read more
The functions you are looking for, are: the_post_thumbnail_url(); // For featured image the_author(); // For author name get_author_posts_url(); // For author link the_date(); // For post’s date So, your code should be something like this: <div class=”cs-post-carousel-layout”> <div class=”cs-container swiper-container”> <div class=”swiper-wrapper”><?php // define query arguments $args = array( ‘posts_per_page’ => 5, // your ‘x’ … Read more
You won’t be able to delete the image per se, but using CSS you can hide the image. You should also make sure you fix the typo inside of your inline style it should read background-image: url(…). For the varying styles, you can utilize media queries to hide at a certain point. I don’t recommend … Read more
There are two functions you can use for this: wp_get_attachment_url to get the full sized image or wp_get_attachment_thumb_url, which gets the url of the thumbnail of that attachment. Either function takes the attachment id as the sole argument: $attachment_id= 25; //Get the full url $url = wp_get_attachment_url( $attachment_id ); //get the thumbnail $thumb = wp_get_attachment_thumb_url( … Read more
If you define a meta tag with the og:image property, facebook will pick this up as the image associated with that url. https://developers.facebook.com/docs/opengraphprotocol/
This is quite simple to implement, using core post-thumbnails functionality. First, you need to add Theme support for the feature, via functions.php: <?php function wpse54920_setup_theme() { // Support post thumbnails add_theme_support( ‘post-thumbnails’ ); } add_action( ‘after_setup_theme’, ‘wpse54920_setup_theme’ ); ?> Next, you need to define your custom image sizes, using add_image_size(). Let’s say you want the … Read more