Skip to content

Instantly share code, notes, and snippets.

@nicmare
Created July 17, 2023 13:45
Show Gist options
  • Select an option

  • Save nicmare/9db62da66c262194e62e57fe8aac3845 to your computer and use it in GitHub Desktop.

Select an option

Save nicmare/9db62da66c262194e62e57fe8aac3845 to your computer and use it in GitHub Desktop.
<?php
function default_archive_card_img($args){
if(empty($args["featured_image"]))
$args["featured_image"] = blocksy_media(array(
"attachment_id"=>get_page_by_path("default_image_name")->ID,
'ratio' => '4/3',
'class' => 'boundless-image',
'tag_name' => 'a',
'size' => "medium_large",
'html_atts' => [
'href' => esc_url(get_permalink()),
'aria-label' => wp_strip_all_tags(get_the_title()),
]
));
return $args;
}
add_filter('blocksy:archive:render-card-layers','default_archive_card_img');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment