Hi,
In a previous thread, I had some issues getting the custom search to work on an author archive, I've got the custom search working but it had a negative effect on the author archive.
See the previous thread here: https://toolset.com/forums/topic/ad-custom-search-to-author-page/
Now normally the author archive looks like this: Screen Shot 2018-02-23 at 10.19.58.png
There is a logo and custom fields displayed at the top of the page.
However, once I add the query filter for the custom search that information no longer displays, see: Screen Shot 2018-02-23 at 10.18.56.png
The thread on how I got that information at the top to display can be found here: https://toolset.com/forums/topic/need-more-help-with-adding-content-to-author-archive/
Hi Minesh,
I did some more troubleshooting but still no luck.
Have you had a chance to have a look at my issue yet?
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Ok - I checked and I would like to know here - the information at top is you want to display those information related to the current displayed author - correct?
That's correct yes.
The information at the top is related to that specific author. Each author on the site will have similar on their respective pages.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Unfortunately the FTP access details you sent to me in previous ticket is not working now. Could you please send me working FTP access details.
I have set the next reply to private which means only you and I have access to it.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
I've added following code to your current theme's functions.php file - to get the ID current author archive we are displaying:
function func_get_author_object_id( $atts ) {
$x = explode("/",$_SERVER['REQUEST_URI']);
$custom_user = get_user_by( 'slug', $x[count($x)-2]);
return $custom_user->ID;
}
add_shortcode( 'get_author_object_id', 'func_get_author_object_id' );
And created following view:
=> hidden link
And in your layout called the view as:
[wpv-view name="author-info-view" users="[get_author_object_id]"]
You can format the output within view as per your requirement. I can see now its displaying the correct results.
Hi Minesh,
Firstly thank you very much for all your help so far, it really is appreciated.
I just tried to check the website but got an error, when I checked the theme folder I noticed the functions.php file is not there.
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Well - I can see that all working fine here:
=> hidden link
Could you please confirm?
Hi Minesh,
Once again thank you very very much.
I added the rest of the query filters and tested the search, everything is working fine now.
Greatly appreciate your help.