Okay
  Public Ticket #1231396
Search Results
Closed

Comments

  • Michelle started the conversation

    I have created several Wiki pages and was using the Page Builder. When I perform a front end search none of the content of those pages is displayed in the search results, just the title.  Is there a way to display some excerpt of a page that uses Page Builder?

  • Michelle replied

    I decided it might just be easier and cleaner to enable custom excerpts on the wiki so that I can control what is displayed.  Seems to work.

  •  76
    Marcos replied

    Hello Michelle,

    Thank you for getting in touch with us. Have you managed on how to solve your issue? Is it solved? Please let me know. Have a nice day.

    Kind Regards,

    Marcos 

    Looking for visibility? Be featured on Woffice.io

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  • Michelle replied

    Yes, its resolved ...in that I went a different direction.

    I added excerpts to the wiki post-type, then I also modified the Woffice_Frontend.php (in my child theme) to allow front end edit of the excerpt for wiki's.

    Now the excerpt (that does NOT use the Page Builder) is what is displayed on search results.  

    Wordpress search results are not generally ideal anyway, so excerpts are better in some ways anyway.

  •  76
    Marcos replied

    Hello,

    Glad it works now! Don't hesitate in asking if you need further assistance. Have a nice day.

    Kind Regards,

    Marcos 

    Looking for visibility? Be featured on Woffice.io

    Keen on Woffice ? Please take a few seconds to give us a 5-star review on ThemeForest.

  • jt240703 replied

    Marcos,

    I have this same problem but I don't have the technical ability Michelle has to fix it on my own. Can you help? Is there a setting or some code I can copy and paste?

  • Michelle replied

    jt,

    I'm a newbie at wordpress as well, but tend to be good at getting a workable solution if I have to....in any case, if you want my solution here is what I did:

    1) in my child theme /themes/woffice-child-teme/functions.php I added this

     function sfgxx_add_excerpts_to_wiki() {
        add_post_type_support('wiki', 'excerpt');
    }
    add_action('init', 'sfgxx_add_excerpts_to_wiki');

    2) in my child theme /themes/woffice-child-theme/inc/classes  I copied the file from the main theme called Woffice_Frondend.php

    Added this to the $post_information array around line 84.....

     'post_excerpt' => $_POST['post_excerpt'],
    Then around line 760 (just before Editor)....
         /**
          * Excerpt
          */
        if ( $type == 'wiki' ) {
             $html .= '<p>';
                 $html .= '<label for="post_excerpt">'. $base_label . ' '. __( 'excerpt:', 'woffice' ).'</label>';
                 $settings = array(
                     'textarea_name' => 'post_excerpt',
                     'textarea_rows' => '10',
                     'dfw'           => true
                 );
                 $excerpt_val = (!empty($post_id)) ? get_the_excerpt($post_id) : '';
                 ob_start();
                 wp_editor( $excerpt_val, 'post_excerpt', $settings );
                 $html .= ob_get_clean();
             $html .= '</p>';
    }

    Hope this helps.  

  •  495
    Antonio replied

    Thank you so much for your sharing Michelle

    Best Regards,
    Antonio.