GuidePlugin LogoGuidePlugin Docs

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);
ParameterTypeDescription
$item_htmlstringHTML of the single result post
$post_idintThe ID of the result post
$guide_idintThe 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();
        ?&gt;

        &lt;div class="result-item"&gt;
            &lt;a href="&lt;?php echo get_permalink($post_id);?&gt;"&gt;&lt;?php echo get_the_title($post_id);?&gt;&lt;/a&gt;
        &lt;/div&gt;
        &lt;?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