AI助手支持GPT4.0
Blade is the template engine for Laravel, a very popular php framework, developed by Taylor Otwell.
Blade是Laravel的模板引擎,Laravel是由Taylor Otwell开发的非常流行的php框架。
This plugin brings the same template engine to wordpress.
此插件为Wordpress带来了相同的模板引擎。
Using a template engine will result in much cleaner template files and quicker development.
使用模板引擎将使模板文件更整洁并加快开发速度。
Normal php can still be used in the template files.
普通的php仍然可以在模板文件中使用。
The plugin also adds a wordpress specific snippet to blade.
该插件还向刀片添加了wordpress特定的代码段。
Check out the examples for more info.
查看示例以获取更多信息。 p>
{{$foo}} {{$$ foo}} code> pre>Turns into… 变成... p>if() if() h4>@if(has_post_thumbnail()) @if(has_post_thumbnail()) {{the_post_thumbnail() }}{{the_post_thumbnail()}}@else @其他 @endif@万一 code> pre>Turns into…变成... p> {{the_title()}} {{the_title()}} @wpempty @wpempty 404 404 p>@wpend@wpend code> pre>Turns into…变成... p> p>404 404 p>wordpress query wordpress查询 h4> @wpquery(array('post_type' => 'post')) @wpquery(array('post_type'=>'post')) {{the_title()}} {{the_title()}} li>@wpempty @wpempty {{ __('Sorry, no posts matched your criteria.') }} {{__('对不起,没有符合您条件的帖子。')}} li>@wpend@wpend ul> code> pre>Turns into….变成...。 p> ‘post’) );“帖子”)); ?> ?> have_posts() ) : ?> have_posts()):?> have_posts() ) : $query->the_post();have_posts()):$ query-> the_post(); ?>?> p> li> li> ul>Advanced Custom Fields高级自定义字段 h4> @acfrepeater('images') @acfrepeater('图像') {{ get_sub_field( 'image' ) }} {{get_sub_field('image')}} li> @acfend@acfend ul> code> pre>Turns into…变成... p>Blade documentation for more info.<有关更多信息,请参见刀片文档。< /p>/ p>Contribute on github: github.com/MikaelMattsson/blade在github上贡献: github.com/MikaelMattsson/blade p>
{{$$ foo}}
code> pre>
Turns into…
变成...
p>
@if(has_post_thumbnail()) @if(has_post_thumbnail()) {{the_post_thumbnail() }}{{the_post_thumbnail()}}@else @其他 @endif@万一 code> pre>Turns into…变成... p> {{the_title()}} {{the_title()}} @wpempty @wpempty 404 404 p>@wpend@wpend
@if(has_post_thumbnail()) {{the_post_thumbnail() }}{{the_post_thumbnail()}}@else @其他 @endif@万一
{{the_post_thumbnail() }}
{{the_post_thumbnail()}}
@else
@其他
@endif
@万一
变成... p>
{{the_title()}}
{{the_title()}}
@wpempty
404
404 p>
@wpend
@wpquery(array('post_type' => 'post')) @wpquery(array('post_type'=>'post')) {{the_title()}} {{the_title()}} li>@wpempty @wpempty {{ __('Sorry, no posts matched your criteria.') }} {{__('对不起,没有符合您条件的帖子。')}} li>@wpend@wpend ul> code> pre>Turns into….变成...。 p> ‘post’) );“帖子”)); ?> ?> have_posts() ) : ?> have_posts()):?> have_posts() ) : $query->the_post();have_posts()):$ query-> the_post(); ?>?> p> li> li> ul>Advanced Custom Fields高级自定义字段 h4> @acfrepeater('images') @acfrepeater('图像') {{ get_sub_field( 'image' ) }} {{get_sub_field('image')}} li> @acfend@acfend ul> code> pre>Turns into…变成... p>Blade documentation for more info.<有关更多信息,请参见刀片文档。< /p>/ p>Contribute on github: github.com/MikaelMattsson/blade在github上贡献: github.com/MikaelMattsson/blade p>
@wpquery(array('post_type' => 'post')) @wpquery(array('post_type'=>'post')) {{the_title()}} {{the_title()}} li>@wpempty @wpempty {{ __('Sorry, no posts matched your criteria.') }} {{__('对不起,没有符合您条件的帖子。')}} li>@wpend@wpend ul>
@wpquery(array('post_type' => 'post'))
@wpquery(array('post_type'=>'post'))
ul>
Turns into….
变成...。 p>
‘post’) );
“帖子”));
?>
?>
have_posts() ) : ?>
have_posts()):?>
have_posts() ) : $query->the_post();
have_posts()):$ query-> the_post();
?> p>
@acfrepeater('images') @acfrepeater('图像') {{ get_sub_field( 'image' ) }} {{get_sub_field('image')}} li> @acfend@acfend ul> code> pre>Turns into…变成... p>Blade documentation for more info.<有关更多信息,请参见刀片文档。< /p>/ p>Contribute on github: github.com/MikaelMattsson/blade在github上贡献: github.com/MikaelMattsson/blade p>
@acfrepeater('images') @acfrepeater('图像') {{ get_sub_field( 'image' ) }} {{get_sub_field('image')}} li> @acfend@acfend ul>
@acfrepeater('images')
@acfrepeater('图像')
@acfend
有关更多信息,请参见刀片文档。<
/p>
/ p>
Contribute on github: github.com/MikaelMattsson/blade
在github上贡献: github.com/MikaelMattsson/blade p>
blade
/wp-content/plugins/
blade code>上载到 / wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>Make sure that /wp-content/plugins/blade/storage/views/ is writable by php 确保 / wp-content / plugins / blade / storage / views / code>可被php写入 li>Done!完成!You can now use Blade in your theme您现在可以在主题中使用Blade li>
/ wp-content / plugins / code>目录 li>Activate the plugin through the ‘Plugins’ menu in WordPress通过WordPress中的“插件”菜单激活插件 li>Make sure that /wp-content/plugins/blade/storage/views/ is writable by php 确保 / wp-content / plugins / blade / storage / views / code>可被php写入 li>Done!完成!You can now use Blade in your theme您现在可以在主题中使用Blade li>
/wp-content/plugins/blade/storage/views/
/ wp-content / plugins / blade / storage / views / code>可被php写入 li>Done!完成!You can now use Blade in your theme您现在可以在主题中使用Blade li>
You can now use Blade in your theme
您现在可以在主题中使用Blade li>
ol>
It is recommended thay you change the path to the location where the compiled views are stored to within your theme.
建议您将路径更改为主题中已编译视图存储的位置。
This will fix problems with wpml.
这将解决wpml的问题。
To do so, put the following code in your theme folder and create the folder/directory “bladecache” in your theme folder.
为此,请将以下代码放在主题文件夹中,然后在主题文件夹中创建文件夹/目录“ bladecache”。
if(function_exists(‘blade_set_storage_path’)){
if(function_exists('blade_set_storage_path')){
blade_set_storage_path(get_template_directory().’/bladecache’);
blade_set_storage_path(get_template_directory()。’/ bladecache’);
}
} p>
原文出处:http://www.sanshu.cn/a/4776.html
群主管理都是支付大佬