Skip to content

Commit

Permalink
Merge pull request #42 from zync09/windows-blocks-fix
Browse files Browse the repository at this point in the history
Use relative url for block loading
  • Loading branch information
cearls authored Aug 2, 2024
2 parents 4342920 + 7299552 commit d922466
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions theme/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function enqueue_assets() {
$dist_uri = get_template_directory_uri() . '/assets/dist';
$dist_path = get_template_directory() . '/assets/dist';
$manifest = null;

if ( file_exists( $dist_path . '/.vite/manifest.json' ) ) {
$manifest = json_decode( file_get_contents( $dist_path . '/.vite/manifest.json' ), true );
}
Expand Down Expand Up @@ -148,7 +148,8 @@ function acf_block_render_callback( $block, $content ) {
$context['post'] = Timber::get_post();
$context['block'] = $block;
$context['fields'] = get_fields();
$template = $block['path'] . '/index.twig';
$block_name = explode( '/', $block['name'] )[1];
$template = 'blocks/'. $block_name . '/index.twig';

Timber::render( $template, $context );
}
Expand Down

0 comments on commit d922466

Please sign in to comment.