Forum Replies Created
Viewing 1 post (of 1 total)
-
AuthorPosts
-
J KornMember
Thanks for the response, Carrie.
Are you using your own custom loop/query or using genesis_custom_loop to loop through your posts?
No. I'm using a template, archive-customtype.php, and within that, just trying to filter the image to add in/modify the class. I was looking through the Genesis code, specifically the image.php file and saw the following within genesis_get_image:
$defaults = apply_filters( 'genesis_get_image_default_args', array( 'format' => 'html', 'size' => 'full', 'num' => 0, 'attr' => '', 'fallback' => 'first-attached', ) );
So, I assumed I could filter the genesis_get_image_default_args, however, my code above seems to have no effect. I've found another way around what I was trying to do, but seems like using genesis_get_image_default_args would have made more sense.
For your reference, here is what my archive template looked like before (pretty straight forward):
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); // Remove post info remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); // Remove post meta add_filter( 'genesis_get_image_default_args', 'korndev_archive_image'); // Modify image function korndev_archive_image( $args ){ $args = array( 'attr' => array('class'=>'aligncenter') ); return $args; } genesis();
Thanks!
-
AuthorPosts
Viewing 1 post (of 1 total)