Hi,
I have an archive view that I needed to copy entirely into a simple view.
I use both, but would like, in order to avoid duplicates, to use the Archive view as a shortcode instead of using the simple view.
How would this be possible ?
Thank you.
Are you creating your view with a content template attached? Meaning you are using the classic method to create your view?
What you can do is to call the content template of your archive inside the new view that you create so you wouldn't need to create a new template for each of the views that you created.
Hello and thank you,
I am already using a common content template for both the archive view and the simple view, but :
- that doesn't help for the query and filters;
- that still makes 2 different views instead of a single one;
- that causes several strange bugs.
It would be better to be able to call the archive view with a shortcode.
Thank you.
It would be better to be able to call the archive view with a shortcode.
Unfortunately because of the way how archives work it wouldn't be possible to call the archive itself using a shortcode.
This is because the custom archives interact directly with the wordpress archive template itself and overwrites it directly rather than using a shortcode.
Only a view will generate a shortcode that can be used on multiple pages.
I understand, thank you.
Is there any way to code a function that would create a shortcode able to call the archive view ?
If so, could you please point me the documentation ?
Thank you.