Modify search result page

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #16278

    How can I get staff to show up in search results – without a “read more” link? That is it will show the staff picture and the info (email phone etc).

    Guess I need to elaborate a bit 🙂
    On I’ve removed the “single detail page” (like for the staff members, because it was not needed.

    I suspect modifying and overriding ‘blog-content.php’ might be a starting point.

    Any help greatly appreciated 🙂 thanks!

    (btw: at the moment I have disabled ‘staff’ post-type from being found in search)


    You are right- you will need to modify the blog-content.php file at around line number 155 (the function mo_display_post_content_list_style()) to have code that looks something like this –

    if ('staff' == get_post_type()) {
                                    $phone = get_post_meta(get_the_ID(), 'mo_phone', true);
                                    if (!empty($phone)) {
                                        echo '
  • '; echo '<i class="icon-phone12"></i>'; echo '<span class="value">' . $phone . '</span>'; echo '
  • '; } } else { $disable_read_more_button = mo_get_theme_option('mo_disable_read_more_button_in_archives'); if (!$disable_read_more_button) echo '<span class="read-more">' . __('Read More', 'mo_theme') . '</span>'; echo ''; echo ''; echo ' <!-- .entry-snippet -->'; }

    The search.php file makes a call to this function indirectly via mo_display_archive_content() call. You can also modify that particular file and replace it with typical wordpress loop found in blog-content.php if you do not want to modify blog-content.php.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Invent Theme Support’ is closed to new topics and replies.