Re-process Images

When you insert an image into a WordPress post, its display size is determined by the size setting you pick on the insert dialog: If your server is configured to support WordPress’s image resizing (most common hosts configure their servers so this isn’t an issue), a resized version of the image you enter should be … Read more

How to get all attachment image from post ?? WordPress

<?php /* * Template Name: Gallery Page */ $query_images_args = array( ‘post_type’ => ‘attachment’, ‘post_mime_type’ => ‘image’, ‘post_status’ => ‘inherit’, ‘posts_per_page’ => – 1, ); $query_images = new WP_Query( $query_images_args ); ?> <?php get_header();?> <div class=”main”> <div class=”row”> <?php foreach ( $query_images->posts as $image ) {?> <div class=”col-md-3″> <img src=”<?php echo wp_get_attachment_url($image->ID); ?>” > <a … Read more

Is it possible to list post attachments in a sub URL endpoint with a dedicated template?

I think I found it myself. Now I’ve successfully managed to add a /photos endpoint to a permalink URL, such as: http://mywordpressite.com/projects/a-project/photos And then a custom template, photos.php will load and show – with access to the global $post variable. Helpful links: http://codex.wordpress.org/Rewrite_API/add_rewrite_endpoint http://codex.wordpress.org/Template_Hierarchy In my functions.php I added functions for the single_template and query_vars … Read more

Get the size (size in Kb or MB) of an featured image?

You can use get_attached_file() to: Retrieve attached file path based on attachment ID. And get_post_thumbnail_id() to determine the post thumbnail of the current post, or any post if you set the $post_id parameter. Exemplary usage: $bytes = filesize( get_attached_file( get_post_thumbnail_id() ) ); Use size_format() to Convert a given number of bytes into a human readable … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)