tvermand
Forum Replies Created
-
Zdravei Ivan!
Thank you for your reply.
Indeed, it works but not always. I found that wp_delete_attachment() can behave a strange way… Especially when using wp all import. I happens that the attachment is deleted in WP database, but not the file on the server. I cannot reproduce it all the time.
Let’s say it’s ok.Thanks again for your help!
Have a nice day,
TzvetanForum: Plugins
In reply to: [Pronamic Google Maps] Change color mapThank you very much for your quick answer! I was not so far from the truth ??
Forum: Reviews
In reply to: [WP Favorite Posts] FrustratedOk, I found.
For those who might be interested:
change that line:
$qry = array('post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page);
and add your custom post type:
$qry = array('post_type' => 'your_custom_post_type', 'post__in' => $favorite_post_ids, 'posts_per_page'=> $post_per_page, 'orderby' => 'post__in', 'paged' => $page);
Forum: Reviews
In reply to: [WP Favorite Posts] FrustratedHi, I’m having the same issue, I use custom post type and it’s not working.
Where did you change the post_type? I cannot find that in any file.
Thanks an lot.Forum: Plugins
In reply to: [BJ Lazy Load] Not working with attachmentsSeem’s that it’s missing closing } related to if. Should be placed at the end.
But my template has a lot of custom stuffs. See that shorter code that I used in content.php of twentyfourteen theme to test the plugin:
<?php $attachments = get_children(array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order')); if ( ! is_array($attachments) ) continue; $count = count($attachments); $first_attachment = array_shift($attachments); ?> <div class="left"> <?php $img_html = wp_get_attachment_image($first_attachment->ID , 'thumbnail'); $img_html = apply_filters( 'bj_lazy_load_html', $img_html ); echo $img_html; ?> </div>
Is it working for you?
Forum: Plugins
In reply to: [BJ Lazy Load] Not working with attachments<?php $args = array( 'post_type' => 'attachment', 'post_status' => null, 'post_parent' => $fr_ID, 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC' ); $attachments = get_posts( $args ); if( $attachments ) { $thumb_images = array(); foreach( $attachments as $key => $attachment ) { $thumb_image = wp_get_attachment_image_src( $attachment -> ID, 'thumbnail' ); $thumb_images[] = $thumb_image[0]; } natsort( $thumb_images ); ?> <?php // Apply lazy load filter to images $img_lazy_load = '<img src="'.$thumb_images[0].'" alt="'.esc_attr( get_the_title() ).'" />'; $img_lazy_load = apply_filters( 'bj_lazy_load_html', $img_lazy_load ); echo $img_lazy_load; ?>
I use a foreach because I have more than one image per post and need them after in my template.
Hope it helps…Forum: Plugins
In reply to: [BJ Lazy Load] Not working with attachmentsThanks, you rock, works great!
Forum: Plugins
In reply to: [Network Latest Posts] Select posts using custom taxonomyYou rock, that’s a really fast, fast answer ??
Thanks for the clue, I was in the process of testing that just before you answered, and it works like a charm!
Thanks again and all the best!
Tzvétan