WordPress.org

Ready to get started?Download WordPress

Forums

Simple User Listing
[resolved] Shortcode for custom search (by a meta field) (8 posts)

  1. bogdansc
    Member
    Posted 10 months ago #

    Hi,

    I created the search-author.php as you instructed in the FAQ section of your plugin to search users by a custom field in their profile. What is the shortcode to use for this custom search?

    http://wordpress.org/plugins/simple-user-listing/

  2. helgatheviking
    Member
    Plugin Author

    Posted 10 months ago #

    There is only the one shortcode: [userlist]

  3. bogdansc
    Member
    Posted 10 months ago #

    In that case, what modifications must be done (besides adding search-author.php and adding the other piece of code to functions.php) so that the new search by custom field to appear?

    At the moment, on the page where the shortcode is inserted, I still have the old search, the search by name.

  4. bogdansc
    Member
    Posted 10 months ago #

    Sorry. Solved. I was putting the search-author.php in the root folder of the plugin, not in the templates folder. My bad.

  5. helgatheviking
    Member
    Plugin Author

    Posted 10 months ago #

    Glad you solved it. The basic how-to for customizing the templates is covered on the main plugin page: http://wordpress.org/plugins/simple-user-listing/

  6. bogdansc
    Member
    Posted 10 months ago #

    Also, I'm curious of something. Is there a way to search through two custom fields, and not just one?

  7. helgatheviking
    Member
    Plugin Author

    Posted 10 months ago #

    Yes it is possible. You just have to manipulate the user query arguments appropriately.

  8. helgatheviking
    Member
    Plugin Author

    Posted 8 months ago #

    For future readers, setting up a search by a meta field is covered in the FAQ.

Reply

You must log in to post.

About this Plugin

About this Topic