Skip Navigation

[Resolved] Templating with Beaver Builder

This thread is resolved. Here is a description of the problem and solution.

Problem:
Can I edit the entire template of a WordPress Archive created with Toolset, using Beaver Builder?

Solution:
You can edit the Content Template applied to the single items in the resulting Archive loop (results, posts seen on the front end in that ardhive).
You cannot edit the entire template inclusive search, sidebar, footer or headers

Relevant Documentation:
https://toolset.com/documentation/user-guides/using-toolset-with-beaver-builder/

This support ticket is created 5 years, 7 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by kristopherL 5 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#1255397

Hi folks,
Sorry, ramping up with Toolset and I'm running into some roadblocks. Mainly understanding when to use Astra's options vs beaver builder vs toolset.

Here's my scenario: I have a custom post type called "authors" that has a many-to-many relationship to posts. I want to style the single and archive templates with Beaver Builder. I'm getting stuck on this technote: https://toolset.com/documentation/user-guides/using-toolset-with-beaver-builder/creating-templates-for-wordpress-archive-pages-with-beaver-builder/

Here's the questions:

1. I have author archive template that loops through the authors with a content template styled with Beaver Builder. BUT how do I style the overall archive template with beaver builder? Say if I want content before the loop.

2. On the author archive loop and also on the single author template, I want to show 3 of their most recent posts. So I need a loop inside of a loop. How exactly do I go about doing this, with a View?

#1255591

1. That is not possible since the Beaver Builder is a content designer applying its design to the Content Template, which replaces the single post in the archive loop. Only Toolset Layouts is able to replace the entire Template and let you add stuff outside the loop/content area such as sidebars, headers and so on.
But if you use Toolset Layouts it'd not reccomended to use another page/content builders.

2. I am not sure what you mean by single author template.
In WordPress generally, there is just the Author archive but no single template - those are all archives (loops):
author-{nicename}.php - If the author's nice name were rami, WordPress would look for author-rami.php.
author-{id}.php - If the author's ID were 6, WordPress would look for author-6.php.
author.php
archive.php
index.php
https://codex.wordpress.org/Author_Templates

On the other hand, an Author archive is a loop of the posts the user wrote, so there will be many outputs (as many as there are posts by that user).

Each author archive displays only the posts of that author, so it already functions as the list of posts by the author seen in the archive.
To limit it's output to 3 you can set so in hidden link, but that only has an effect on the blog...

In this case, I think you want to have an author archive but only list 3 of his/her posts listed - if this is correct, you could follow as below. Note, you could also create a View and display the Posts by a certain author, and limit it to 3 - so to insert that later to a page. However, that wouldn't be an archive.

---

Because the archives cannot be limited in the output, you'd have to create a View, which lists the posts, and then insert that View to the archive, but outside it's loop.
- Create a new Post View and query the post type to show, limit it to 3 items
- Add a Query Filter as "Select posts which author's username is set by the View shortcode attribute "author" eg. [wpv-view name="view-name" author="admin"]"
- Complete the Loop of this View to show posts data
- Insert the View outside of the archive's loop like this:

[wpv-layout-start]
	[wpv-items-found]
	<!-- wpv-loop-start -->
[wpv-view name="posts-view" author="[wpv-archive-title]"]
		<wpv-loop>
		</wpv-loop>
	<!-- wpv-loop-end -->
	[/wpv-items-found]
	[wpv-no-items-found]
		<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
	[/wpv-no-items-found]
[wpv-layout-end]

As you can see I pass the [wpv-archive-title] to the View so the View can display posts by that user only of which we see the archive.
The View itself limits to 3 posts, so I see only 3 posts.

Note, for the [wpv-archive-title] to return only the real username (without any HTML or "Author archives:" string), you'd have to add a filter to your theme's functions to clean it out of the unwanted HTML:

add_filter( 'get_the_archive_title', function ($title) {

    if ( is_author() ) {

            $title = get_the_author();

        }

    return $title;

});

One could also return that in a Custom ShortCode to populate the View's attribute, if wanted.

#1256965

Hi Beda, thank you so much for the quick reply! Real quick about #1, I understand. I want to keep towards using Beaver Builder, and not use Toolset Layouts. How does this work for a solution?
-- Build out my page (author archive) through Beaver Builder (so it's not a true archive), and
-- where I need the loop of record, I insert a pre-made content template or view?

Would that work? Thanks! Kris

#1257963

It is not possible, as I elaborated in #1 above. Beaver Builder cannot edit entire Templates (from header to footer) as far I know.
In any case, even if it could, you could not apply it's design thru a Content Template to the entire Page Template since Content Templates do apply only to the_content() part (the post body).

Your proposed solution (Note, as said I am not sure you will be able to edit the entire page with the Beaver Builder anyway), would work given that you would insert a View loop that mimics the archive into any page.
This can be done with Views and Beaver Builder, it will however not have the same SEO purpose (URL and other things that SEO asks for and receives in archives).

But as said, I am not sure you can edit entire templates with the Beaver Builder - if you can, then you should be able to display a View inside of it, this is correct, and doing so you are able to mimic the archive as well.

#1276875

My issue is resolved now. Thank you!