guideplugin/result/template
Edit the HTML output of the complete result template
guideplugin/result/template
Definition
With this filter you can edit the HTML output of the complete result template.
This filter allows you to completely customize the entire result template, wrapping all result items with your own HTML structure.
Parameters
apply_filters('guideplugin/result/template', $template, $guide_id, $posts);
Parameter | Type | Description |
---|---|---|
$template | string | HTML of the complete result list |
$guide_id | int | The ID of the guide |
$posts | array | The IDs of each result post |
Example
The example shows you how to customize the HTML output of your results for a certain guide:
<?php
function my_guide_result_template($template, $guide_id, $posts) {
// The guide result you want to modify
if ($guide_id == 24) {
ob_start();
?>
<ul class="result-list">...</ul>
<?php
$template = ob_get_clean();
}
return $template;
}
add_filter('guideplugin/result/template', 'my_guide_result_template', 10, 3);
Usage Scenarios
Custom Layouts
Create grid layouts, lists, or custom HTML structures
Wrapper Elements
Add containers, headers, or footer elements to results
Complete Control
Total customization of how all results are displayed