Hi Joana,
First of all, I’m sorry that I intervene here. I am a bit disparate because I want to solve the problem before 21 of April.
Because you use Genesis (I do the same), and you make this plugin work out for you on posts and pages, can you help me to achieve that too?
I will highly appreciated it if you can help me.
I start this topic, but still no help.
Below is how I display the loop on the blog page
<?php
// Update Image Sizes
update_option( 'thumbnail_size_w', 215, true );
update_option( 'thumbnail_size_h', 135, true );
update_option( 'medium_size_w', 300, true ); //mobile single
update_option( 'medium_size_h', '', true );
update_option( 'large_size_w', 800, true ); //desktop single
update_option( 'large_size_h', '', true );
add_image_size('grid-thumbnail', 215, 135, true); //loop thumbnail
add_image_size('mobile-thumbnail', 300, 188, true); //loop thumbnail mobile
add_image_size('sidebar-thumbnail', 336, 194, true); //single sidebar
add_image_size('grid-thumbnail-x2', 430, 270, true); //loop thumbnail
add_image_size('mobile-thumbnail-x2', 600, 376, true); //loop thumbnail mobile
add_image_size('sidebar-thumbnail-x2', 672, 388, true); //single sidebar
//* Add support for Genesis Grid Loop
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'child_grid_loop' );
function child_grid_loop() {
//* Global vars
global $_genesis_loop_args;
//* Parse args
$args = apply_filters(
'genesis_grid_loop_args',
wp_parse_args(
$args,
array(
'grid_image_size' => 'grid-thumbnail',
'grid_image_class' => 'alignleft',
'grid_content_limit' => 0,
'more' => '',
)
)
);
//* What page are we on?
$paged = get_query_var( 'paged' ) ? get_query_var( 'paged' ) : 1;
//* Set global loop args
$_genesis_loop_args = $args;
//hooks and filters for
remove_action( 'genesis_entry_content', 'genesis_do_post_image', 8 );
add_action( 'genesis_entry_header', 'genesis_do_post_image', 8 );
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_content_nav', 12 );
remove_action( 'genesis_entry_content', 'genesis_do_post_permalink', 14 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
//* The loop
genesis_standard_loop();
//* Reset loops
//genesis_reset_loops();
remove_filter( 'post_class', 'genesis_grid_loop_post_class' );
remove_action( 'genesis_post_content', 'genesis_grid_loop_content' );
remove_action( 'genesis_entry_content', 'genesis_grid_loop_content' );
}
And on this template page I use a genesis_custom_loop:
<?php
/*
Template Name: Top 2015
*/
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'top_2015_do_loop' );
add_filter( 'post_class', 'wwhd_post_class' );
remove_action( 'genesis_post_title', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
remove_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
function wwhd_top_2015_description() {
echo '<h2 class="archive-description">WallWideHD.com Most Popular Wide and HD Wallpapers from 2015. Find High Resolution images to set them as your desktop or mobile device background.</h2>';
}
add_action( 'genesis_before_footer', 'wwhd_top_2015_description', 0 );
function top_2015_do_loop() {
global $paged;
global $_genesis_loop_args; // grab the current wp_query() args
$args = apply_filters(
'genesis_grid_loop_args',
wp_parse_args(
$args,
array(
'category__not_in' => '33,158',
'posts_per_page' => 20,
'meta_key' => 'post_views_count',
'orderby' => 'meta_value_num',
'order' => 'DESC',
'date_query' => array( array('after' => 'January 1st, 2015', 'before' => 'December 31, 2015')),
'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ),
)));
add_action( 'genesis_entry_header', 'genesis_do_post_title' );
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_open', 5 );
add_action( 'genesis_entry_header', 'genesis_entry_header_markup_close', 15 );
genesis_custom_loop( $args) ;
}
genesis();
And finally on single post I call the image like this:
genesis_image( array( 'size' => 'large', 'attr' => array ('class' => 'centered', 'alt' => $title,'title' => $title, 'onContextMenu' => "alert('Please use the Download button bellow for full resolution. Thanks!');return false;") ) );
After all of this I don’t get responsive images or the srcset attribute in the code.
Thank you in advance,
Gabriel