BP Profile Search › Create and use a new Members directory template
-
AuthorPost
-
Michael Spencer
GuestI cannot get a Profile Search Form to use any thing other than the default members index and member loop files.
I have switched to Twenty Nineteen theme to remove any complications with my theme as I could not get it to work but it is just the same problem.
I am using the shortcode =
[bps_directory template=’members/index-2, members/members-loop-2′]
and have copied files into twentynineteen/buddypress/members directory (and amended them slightly by adding a note after “All Members” so I can tell which are being used). But the files in this directory are not used – the files used are in the directory twentynineteen/members – so I copied and amended them there as well but only the default index file is used, not the index-2 and members-loop-2.I have tried amending the path in the shortcode in everyway I can think of but no change.
I am clearly missing something but I do not know what. Can you help please.
Michael Spencer
GuestSorry – forgot to add the page I am working on
https://staging.cosrt.org.uk/register-search-test/andrea
Plugin AuthorHi Michael,
Your shortcode
[bps_directory template='members/index-2, members/members-loop-2']is correct, and it’s correct to put the new templates in the twentynineteen/buddypress/members directory.
In the page you mentioned, I can see
All Members -index 908and that means that your custom template is being used.
If you can’t see it, please be sure to clear your browser’s cache and possibly other caches you’re using. Does that change anything?
Michael Spencer
GuestSorry but I think I have not made my point clear enough.
I changed the default index template to have -index shown in this position (so I could see what files are used) and the index-2 template will have index2 in this position. Relevant code of index-2 as shown below
<li class=”selected” id=”members-all”>“><?php printf( __( ‘All Members -index2<span>%s</span>’, ‘buddypress’ ), bp_get_total_member_count() ); ?>
This is my problem – it uses the index.php file not the index-2.php file.
Michael Spencer
GuestHi Andrea,
Sorry a further point – it is not using the files in twentynineteen/buddypress/members directory. As these files have would show
bpindex or bpindex2 if they were being used. It appears to be using files from
twentynineteen/members directory.andrea
Plugin AuthorHi Michael,
Thank you for letting me use your staging site.
For the record, we had to remove the twentynineteen/members directory, and now everything is working properly.
-
AuthorPost