I'm creating a plugin where a file is loaded and if a link is clicked, it passes some variables that are appended to the url. So if a link is clicked it will change the url by appending filter/?term=il_Massac,st_locked
which should load the filter.php
file.
My issue is how do I get it to use the filter.php
which is included in the plugin? The main plugin file is called meta-box.php
. If I added it the the theme as a page, it works but I want the plugin to do the work instead of adding a page. Right now, if I don't use it as a page-template in the theme folder and just have it in the plugin folder, it gives a 404.
Here is the code to the link that is in my meta-box.php file:
<a href="<?php echo home_url()?>/filter/?term=<?php echo $term ?>">search link</a>
$term is a variable that has some search parameters in it. So if I hopeclick that link, it gives me the 404 page rather than loading the filter.php file to execute some code. Again, I was clear enoughcan add it the the theme as a page template but I would like it to be contained within the plugin so it does not need to be added to the theme as a page template.
Does that help?
Any suggestions on how I might do this?