SOLVED: Standard blog archive template - not applied + wrong dynamic data

Bricks Version: 1.4
WP Ver.: 6.0
Browser: Edge - Latest
OS: Windows
URL: localwp.com install running NGINX PHP7.4 and MySQL8

So I have 2 problems with the standard Blog page - aka main Posts Page.

  1. The archive template doesn’t apply to it. I have it configured in the template conditions to apply to All Archives, in which the main Posts Page is clearly an archive. However, the page still shows unstyled, without my custom template applied to it.
    image
  2. If I force the template to apply to this Posts Page by selecting it with an Individual > Page rule, then it shows me the wrong excerpt. More precisely, it takes into account my page title but gets the except from the first blog post in the archive list, not the one I have configured in the Page edit screen in the Excerpt field.

Let me know if you need more details to reproduce this on your end, I’d be glad to help fix this. It happened in older Bricks versions as well, so this is nothing new.

EDIT:
How this should behave?

  1. It should consider the Posts Page I have configured in my settings /wp-admin/options-reading.php as an archive page and apply the “All Archives” template to it as well.
  2. It should read the dynamic data from the Page (because this is a real page) in the background, and output the proper Excerpt I have configured for it. It should NOT use the first post it sees in the query to get the Excerpt from that one as it does right now.

EDIT 2:
Another observation that might help is if you edit the template and select in the Populate Content section the main Blog Page you have configured in your WP settings, it will show the Excerpt correctly in Preview, but when loading the page normally it will show the wrong Excerpt. However, even if the Excerpt shows correctly, in this case, the pagination preview doesn’t work if you select the individual page for preview.

Also, if you ask me, this main Posts Page should be the default preview for an Archive page. So you might also consider implementing this as the default preview as well?

Hi,

Q1: In Wordpress the main blog page (be it website’s homepage or other custom page) is not an archive page, but the “home page”. And it is not detected the same way as archives.

I agree it can be confusing but this is how it works: Conditional Tags | Theme Developer Handbook | WordPress Developer Resources

(I guess this comes from the days when WP was only a blog engine and couldn’t handle more standard pages.)

So you need to use a specific condition for the template.

Q2: Archive pages don’t have excerpt in WP (excerpts are for single posts only, not even pages, without custom code!).

For blog categories, you can fill the category description instead, and Bricks Post excerpt element will get this as the excerpt :wink:

For other taxonomies, I’m not sure it is even possible, I think you need to add a dedicated field in taxonomy terms, but not sure.

2 Likes

Oh yeah. I remember now. Thank you @yankiara !

is_home() is confusing because it actually returns true for the Posts Page (aka blog home page) while is_front_page() actually returns true for the homepage. And they can be sometimes the same page.

That makes sense. Thank you for the clarifications. Now I get it :slight_smile: then it’s not a bug :relieved:, it’s just a misunderstanding on my part. :man_facepalming:

Q2:
That also makes sense since it’s true that archives don’t have excerpts. I used it in the wrong way due to Q1 misunderstanding.

1 Like