How to get Image `alt` value from WordPress image attachment?

This looks like how you should use WCK: <?php foreach( get_cfc_meta( ‘testimonialsbox’ ) as $key => $value ){ ?> <?php $author_testimonial = $key[‘author_testimonial’]; ?> <?php $photo_obj = get_cfc_field( ‘testimonialsbox’,’photo’, false, $key ); ?> <div class=”col-md-6 col-sm-6″> <?php echo $author_testimonial; ?> <div class=”author-det”> <img src=”https://wordpress.stackexchange.com/questions/279399/<?php echo $photo_obj[“url’] ?>” alt=”https://wordpress.stackexchange.com/questions/279399/<?php echo $photo_obj[“alt’]; ?>”/> </div> </div> <?php } … Read more

WP 5.3 Removing Default WordPress Image Sizes

Using the intermediate_image_sizes_advanced filter was not working for me. However, the intermediate_image_sizes works and the $default_sizes array is an indexed array, not an associative array. In every single example that I have found for using the intermediate_image_sizes_advanced filter, the answer’s are unsetting the image sizes from an associative array. The following worked for me in … Read more

fetch images and videos

The problem with this is that each sites content is formated differently. If there was only one site you were wanting to pull from you maybe able to use curl() and then sort though the content. A better idea may be to grab content from the sites RSS feed and sort though and grab what … Read more

specify size of post preview image (not post thumbnail)

In this case I would add image size in functions.php which registers new image size in my theme and get the re-sized image. Example: Register custom image size (functions.php) if ( function_exists( ‘add_image_size’ ) ) { add_image_size( ‘custom-image’, 440, 265, true ); //(cropped) } Get custom image size (functions.php) function get_custom_image(){ global $post, $posts; $args … Read more

How do you get the full size url of an attachment image

I think you’re overthinking the system. Unfortunately the nomenclature isn’t helping. The Thumbnail here is the actual image when you use get_the_post_thumbnail_url(). as an example. Say today you uploaded an image called myimage.jpg. That would go, if you’re storing images by date into this directory: /wp-content/uploads/2017/07/myimage.jpg. Now when you call : $featured_img_url = get_the_post_thumbnail_url(‘full’); //(or … Read more

how to move from content and place them elsewhere on a page template?

You could use, for example, the_content filter, run a regex to remove the images and grab them in a variable, then print that variable wherever you want. For example, appending all images to the end of the content: add_filter( ‘the_content’, ‘my_the_content_filter’ ); function my_the_content_filter($content) { //$matches will be an array with all images preg_match_all(“/<img[^>]+\>/i”, $content, … Read more

What is the meaning of WordPress’s recommended css classes and where are they applied?

These classes are generated by WordPress. For instance, if a user inserts an image in his post and says it must be aligned right, WP will generate code like this in the post: <img class=”alignright” src=”https://wordpress.stackexchange.com/questions/247130/…”> Now, if your theme doesn’t define the alignright class, the image won’t be aligned right and the user won’t … Read more

Stop Images Linking to Themselves?

To change the default for images (so you don’t have to choose “none” on the image links to checkboxes every time you insert an image into a post), you can go to yoursite.com/wp-admin/options.php; find the image_default_link_type option, and change the value from “file” to “none”.

remove and disable image link in functions.php

A little late to this party but it seems the OP wants to (1) prevent these WP Selfies from recurring and (2) remove existing WP Selfies. Here is a great filter to prevent it from happening in the future: http://andrewnorcross.com/tutorials/stop-hyperlinking-images/. And I just posted a snippet that removes existing self linking images here: http://cfxdesign.com/remove-existing-self-linking-images-in-wordpress/.