Skip to main content
Tried to explain my issue better. Let me know if I'm still not clear.
Source Link

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?

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.

I hope I was clear enough.

Any suggestions on how I might do this?

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 click that link, it gives me the 404 page rather than loading the filter.php file to execute some code. Again, I can 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?

improved code formatting
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

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'filter/?term=il_Massac,st_locked which should load the filter.phpfilter.php file.

My issue is how do I get it to use the filter.phpfilter.php which is included in the plugin? The main plugin file is called meta-box.phpmeta-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.

I hope I was clear enough.

Any suggestions on how I might do this?

Thanks in advance!

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.

I hope I was clear enough.

Any suggestions on how I might do this?

Thanks in advance!

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.

I hope I was clear enough.

Any suggestions on how I might do this?

Source Link

how to load a file from a plugin when a url is passed

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.

I hope I was clear enough.

Any suggestions on how I might do this?

Thanks in advance!