guideplugin/result/item_html
Edit the HTML output of individual results
guideplugin/result/item_html
Definition
With this filter you can edit the HTML output of the individual results.
This filter allows you to completely customize how each result item is displayed in your guides.
Parameters
apply_filters('guideplugin/result/item_html', $item_html, $post_id, $guide_id);
Parameter | Type | Description |
---|---|---|
$item_html | string | HTML of the single result post |
$post_id | int | The ID of the result post |
$guide_id | int | The ID of the guide |
Example
The example shows you how to customize the HTML output of your results for a certain guide:
<?php
function my_guide_result_item($item_html, $post_id, $guide_id) {
// The guide result you want to modify
if ($guide_id == 24) {
ob_start();
?>
<div class="result-item">
<a href="<?php echo get_permalink($post_id);?>"><?php echo get_the_title($post_id);?></a>
</div>
<?php
$item_html = ob_get_clean();
}
return $item_html;
}
add_filter('guideplugin/result/item_html', 'my_guide_result_item', 10, 3);
Usage Scenarios
Custom Styling
Apply custom CSS classes and HTML structure
Additional Content
Add meta information, thumbnails, or excerpts
Interactive Elements
Include buttons, forms, or other interactive components