Skip Navigation

[Resolved] Change the Latest Post layout

This support ticket is created 3 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

This topic contains 18 replies, has 3 voices.

Last updated by Jamal 3 years, 3 months ago.

Assisted by: Jamal.

Author
Posts
#2213307
Screenshot 2021-11-05 at 9.13.20 AM.png

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.

#2214959

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.)

#2215431

Dear Jamal,

Actually, this is a normal page but list the post for different category which look like an archive

#2215547

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.