Support » Plugin: Ajaxy Live Search » [Plugin: Ajaxy Live Search] Filter Out Categories

Viewing 3 replies - 1 through 3 (of 3 total)
  • Ok.. it’s a technical solution that involves hardcoding the plugin, but it works until the next revision. I really like the output of this plugin, but HAD to hide a couple categories due to my customized WP categories.

    You’ll need to know your category IDs..

    Edit the plugin sf.php file and around line 861 you’ll see before that

    foreach($results as $result)
    
    			{

    My categories to hide were 10 and 13, so my code that I inserted at that point is:

    $catoutofloop = get_the_category($result->ID);
    $catID = ($catoutofloop[0]->term_id );
    if ( ($catID != "10") && ($catID != "13") )
    {

    You’ll then need to close your if statement, so find around line 950 at this point

    $posts[] = $pst; 
    
    					}

    And add one more closing backet after that, so the updated code will end:

    $posts[] = $pst; 
    
    					}
    				}
    
    			}
    
    		}
    
    		return $posts;

    I hope this helps someone. The developer told me this will be in the next release.

    Great plugin!
    Can I exclude all search results except for posts and pages?

    Plugin Author Naji Amer

    (@n-for-all)

    Guys, all you need is in the settings of the plugin, you can exclude and include any category, post, tag etc…, please check the settings robgundling before touching the code, it is already there

    regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Ajaxy Live Search] Filter Out Categories’ is closed to new replies.