I managed to create a custom post type (I called it stores) to work in the loop, I plan to create a template with bootstrap to have all the stores the same design and have the capacity to modify all of them with the editor...
What I need is a way to add extra elements to the_post (elements like the_title, the_content or the_time, but custom made, like "the_type" or "the_storetype", etc)
I managed to create a custom post type (I called it stores) to work in the loop, I plan to create a template with bootstrap to have all the stores the same design and have the capacity to modify all of them with the editor...
What I need is a way to add extra elements to the_post (elements like the_title, the_content or the_time, but custom made, like "the_type" or "the_storetype", etc)
Share Improve this question asked Feb 19, 2020 at 17:36 Cheo MolinaCheo Molina 155 bronze badges 3 |1 Answer
Reset to default 0-RESOLVED
I was able to do it by copying the template functions that wordpress gives and modifying them to fetch what I needed to in the DB instead of what they were supposed to get.
the_post()
is not a template tag. It's not something that produces output that you can add it. It's used for setting up the query properly in your template so that you can output stuff. The things you're describing need to be added to the template. – Jacob Peattie Commented Feb 19, 2020 at 23:39