Dear Minesh,
I don't have such issue for this at this moment, I can't implement this so I use a stupid way to do first. You can visit the page hidden link , you should find there are two sections, upper is grid layout showing the first 4 posts and lower showing the next 5 posts with pagination.
Currently I manually make the page for different category individually, I just want to make it more dynamic and I just only call a shortcode with passing the category and then it can render the result.
I attached one of the pages layout view for your reference.
Best regards,
Kelvin.
Hello Kelvin,
I am sorry, but I got confused after reading your last messages and Minesh's messages.
Is this about archives? I mean taxonomy archives, where each term has its own archive?
The last URL you have shared is a regular page, and is not an archive hidden link
You are looking to add the view with a shortcode, so you don't need to build several views, right? What do you want to pass to the view? A term?
Can you share the URLs where do you want to use this view? The URLs will give me more context(is it a page, an archive, etc.)
Dear Jamal,
Actually, this is a normal page but list the post for different category which look like an archive
Awesome, now I understand better.
Please note that we have a known issue where blocks-based views do not enqueue their styles where they are being used using a shortcode:
[wpv-view name="name or slug of the view"]
So, even if we pass the taxonomy term to it as a shortcode attribute, the design might be lost:
[wpv-view name="name or slug of the view" term="[a-shortcode-to-return-the-term]"]
Which let us two options:
- Build the view with the legacy editor. This will enqueue its styles with it.
- Build the view with the blocks editor, and programmatically hook into its query filter argument and add the taxonomy term query. This will need custom code, and will require a way to know which term to use for each page. This can be done using a custom field on pages, or by assigning the same taxonomy to pages, and then assigning to each page the term that we want to use.
Does it make sense?
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
Let me know if you have any questions about any of these two possible solutions.