How to call a page template inside a shortcode?

Asked

Viewed 102 times

0

I created a short code in a plugin that returns me from the registered users database and now I want you to open a profile view when you click on the name of such user, however I do not know how to create this new page template that will house content X of such user that will be transported by URL. I tried to add this template inside the plugin folder but besides getting something like "../wp-content/plugins/meu_plugin/meu_modelo_de_perfil.php", it exits the theme template even using the get_header(), get_sidebar(), get_footer() says the function has not been defined, I don’t think it’s the right or complete way to do such a thing.

  • Create a custom post type and make an ACF attached to it. Then you won’t have work with anything.

  • Hmm... it doesn’t seem right to create a CPT to use only 1 page that will serve as a model, you know?! I would, but it’s not ideal and that’s what I’m looking for, something more direct and "right". Aside from CPT pages can be deleted by wp-admin.

  • With includes I managed to bring the functionality of this page that I created, this looking like a normal page created by wp-admin which is exactly what I want but I still could not solve the problem of the url that is like this: localhost/MEUSITE/wp-content/plugins/MEUPLUGIN/front/views/PROFILE.php I want this url to be short now, without folders, something like: localhost/MEUSITE/PERFIL

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.