WordPress Attachments with old images

To get all featured images belonging to a certain post type, you’d have to get all those posts and the loop through them to get the featured image. Like this: $query = new WP_Query( array( ‘post_type’ => ‘yourposttype’, ‘posts_per_page’=>-1, )); $thumb_list = array (); if ( $query->have_posts() ) { while ( $query->have_posts() ) { $query->the_post(); … Read more

Using Image Sizes for Custom Post Types outside the Loop

You are doing wrong on this part the_post_thumbnail($page->ID, “my-non-working-size”); For the_post_thumbnail() you don’t need to pass post ID, you just have to pass size and attr. More Info – the_post_thumbnail() So try like this the_post_thumbnail(“my-non-working-size”); without passing post ID. Your markup messed up so I’m not sure your actual markup structure. Here is working example … Read more

are unattached media files a problem?

There are no real runtime or developmental issues you can run into when having unattached media. The Media Library is a place for you to keep any past or future media ( whether it be images, pdfs, docs, etc. ). You don’t need to go through and ensure that every media is attached to any … Read more

Image URL and size

Resolved To remove the Class I added this snipped to my function.php function remove_image_class( $classes ) { $unneededClasses = array( ‘size-medium’ ); foreach ($unneededClasses as $unneededClass) { $classes = str_replace($unneededClass . ‘ ‘, ”, $classes); } return $classes; } add_filter( ‘get_image_tag_class’, ‘remove_image_class’ ); As you see, I did define an array which contains all the … Read more

Using a .pdf file as a page in wordpress

just upload it through ftp or your domain hosting panel to your public_html (www) directory. It will be there as a link to www.example.com/myfile.pdf. The case may be that if you have wordpress and installed any security plugins you’ll have to allow the exception within that plugin as well.