Thanks for all the previous help. The web script I’m trying to modify lets you select categories and subcategories and displays those filtered results. I’m trying to modify it so that subcategory pages can be searched by keyword (currently, the script only searches by keyword for the whole site, doesn’t just search sub-category results). It may help to know that when a sub-category page is displayed the url is, for example:…com/videos/category/2/sub__626
The current html code shows this
<?php if ($pt->page == 'category' && $pt->show_sub == true) { ?>
<script type="text/javascript">
$(document).on('change', '#category_id', function(event) {
event.preventDefault();
id = $(this).val();
$('#sub_category_id').html(sub_categories_array["'"+id+"'"]);
});
$(document).on('change','#sub_categories_', function(event) {
window.location.href = site_url+'/videos/category/<?php echo($_GET['id']) ?>/'+$('#sub_categories_').val();
});
</script>
to display the Search Form (that I’ve added to the html page):
<form action="search.php" method="GET" id="sub-search">
<input id="search" name="keywords" type="text" placeholder="Type here">
<input type="submit" value="Search" />
</form>
based on the posted codes above, would something like this work in the php?:
<?php if ($pt->page == 'category' && $pt->show_sub == true) {
include('sub-search');
}
?>
this example didn’t work, but maybe you could provide some guidance, as to what might work?
Any help/guidance/comment with triggering the Form to appear, upon sub_category page being displayed, is appreciated.