Skip Navigation

[Resolved] multiple author archive pages

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: Asia/Hong_Kong (GMT+08:00)

This topic contains 4 replies, has 2 voices.

Last updated by fahimS-2 1 year, 10 months ago.

Assisted by: Luo Yang.

Author
Posts
#2567895

Tell us what you are trying to do?
I have created a toolset archive to show Author archive posts. But in the Loop Selection I can't select a specific author to use that archive with. All of the author pages are using that archive. How can I create different different archives for different different authors?

#2568111

Hello,

There isn't such kind of built-in feature within Toolset plugins, as a workaround you can try with custom PHP codes, you can follow our document to use filter hook "wpv_filter_force_wordpress_archive" to output different WordPress Archive for each author:
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_force_wordpress_archive

More help:
https://developer.wordpress.org/reference/functions/is_author/

#2568165

Can you kindly provide me the code as I am a non technical guy?

#2568937

See below test site:
Login URL:
hidden link

1) Create two WordPress Archive:
- Default author archive
hidden link
Assign to "Author archives"
- author1 archive
hidden link
Don't assign it to any loop

2) Add a custom code snippet:
hidden link
with below codes:

add_filter( 'wpv_filter_force_wordpress_archive', function($wpa_assigned, $wpa_loop){
  	if(is_author(5)){ // specific author user ID
      	$wpa_assigned = '25'; // specific WordPress Archive ID
    }
	return $wpa_assigned;
}, 30, 2 );

Test it in frontend:
Author1 archive page:
hidden link

Other author default archive page:
hidden link

For your reference.

#2569579

My issue is resolved now. Thank you!