A new function get_template_part () is added from 3.0. you can include another file in the current file as its file block.
A new function get_template_part () is added from 3.0. you can include another file in the current file as its file block.
Unlike the get_header () get_footer () get_siderbar functions, these functions also add other functions, such as widgets.
Get_template_part () is only a text block containing html and php and does not hook other content.
$ Loop_slug = 'news ';
As a result, this page contains the loop-news.php
In this way, you can create reusable blocks. for example, you need to display fixed-category articles on the sidebar.
In addition, sometimes our classification framework remains unchanged, while the style of the loop content changes. for example, we only need to display the title for news classification, the product category requires a thumbnail, so that we can use the get_template_part function to call different loop files to complete different display styles when judging that the current category is certain.