Hello, I'm working on a site that was built using the WordPress 2024 theme and I'm having troubles with patterns that I'm hoping you can help resolve. I have this pattern created that is used at the bottom of some of my pages, basically it's just two columns, one should show the latest posts, and one should show oldest posts. So, I tried to do this myself, but I'm not familiar with block editor that much and I actually made things worse. Now the right column shows pages instead of posts and I have no idea why :( Left column looks good, but I made a mess with the right one and I'm scared to touch it further. I figured out that I can actually export/import patterns so I've uploaded an export file and was hoping that you can make the adjustments for me so I can import it back. You can get it from here: Download Pattern Here's an overview of what I need done:
Thanks, Sarah
Hello Sarah,
Sorry for the little setback you encountered.
I have gone through the code to see where it all began from and more importantly to understand how the code worked before even trying to fix the issue. At the same time going through the problem brief, in other to make the content and appearance of the Left and Right Columns the same.
After going through the code about 3 to 5 times I was able to spot where the issues was. Below are my findings and how I resolved them, I have also added some code snippet for clarity. I believe it will help you in resolving it too, if you intent to do it yourself.
\\"postType\\”
attribute set to page instead of post. So I change the \\"postType\\”
attribute of the right column ( Older Post ) from page to post to coincide with the left Column (Latest posts)Change the right column \\"postType\\":\\"page\\", to \\"postType\\":\\"post\\",
\\"perPage\\":
which represents the number of post to be shown for both columns were set to 3 . I change the attribute \\"perPage\\":
number from 3 to 5.Change the \\"perPage\\":\\"3\\” to \\"perPage\\":\\"5\\”
\\"order\\":
of the right column (Older posts) was set to desc
meaning descending order which is not correct, because if the post is in descending order it mean it will show the latest post first before showing the oldest post. But since this category is for the oldest posts and not for the Latest Posts, I changed the post order to asc
meaning ascending; to make the oldest post show first.Change the \\"order\\":\\"desc\\", to \\"order\\":\\"asc\\",