Forums Forums Search & Filter Pro Display author name in template

Viewing 4 posts - 1 through 4 (of 4 total)
  • Anonymous
    #91461

    Hello,

    I use a authors droplist. Is it possible to display the name of the author selected in my search page results ?

    Thank you for your help.

    Regards.

    Trevor
    #91545

    This would depend on the Display Results method you are using. Some depend on the theme template to do this, and the shortcode results method relies on the results.php template we supply with the plugin. See here for the customisation guide.

    Once you have a copy of that template, you would need to follow the coding advice in the WordPress Codex in how to display the author. as there are many ways you can do this, a specific answer is hard. With link to the author’s posts, or their profile? With their name , or nickname, or their avatar?

    Anonymous
    #91601

    Hello Trevor,
    What i meant : You give some snippets to display some informations like thais :

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(802)->current_query();
    echo $sf_current_query->get_field_string("_sft_category").'<br />';
    echo $sf_current_query->get_field_string("_sft_thematique").'<br />';
    echo 'Terme(s): '.$sf_current_query->get_search_term().'<br />';
    echo 'El&eacute;ment(s) trouv&eacutes(s): ' .$wp_query->found_posts;

    I’d like to have a snippet to display the author chosen in my select list. If i try that code, it doesn’t work :

    echo $sf_current_query->get_field_string("authors");

    Is it possible to realize this ? It’s not in your documentation.

    Thank you for your help.

    Best regards.

    Trevor
    #91736

    The display of the author is not part of Search and Filter as such. That is why I pointed you to the WordPress Codex. You can see some examples of the Codex in use in the results.php template that you will find in the wp-content/plugins/search-filter-pro/templates folder. You can see there how the permalink, the title, the categories, the tags, etc. are output.

Viewing 4 posts - 1 through 4 (of 4 total)