Forums Forums Search & Filter Pro Choose which text show in the results excerpt

Viewing 7 posts - 1 through 7 (of 7 total)
  • Anonymous
    #199737

    Hi

    Is there anyway of specifying/controlling which text is pulled through to the results page. At the moment it is taking all the titles, headers and body so it’s not great to read as a results snippet.

    Here’s the results page I’m working on: http://travel.askelena.com/holiday-finder/

    Thanks

    Simon

    Trevor
    #199759

    It appears as though your are using the Shortcode Display Results Method. It looks like you are using a modified version of the results.php file.

    The content you see comes from that file. It is calling up the content probably from the WordPress the_content() function, over which we have no control. What you could do is to show/reveal the Excerpt meta box in the editor and create a custom excerpt for it to use instead.

    Anonymous
    #199763

    Hi Trevor

    This sounds like a good solution: show/reveal the Excerpt meta box in the editor and create a custom excerpt for it to use instead.

    However, I’m not at all sure how to go about this. Are you able to offer any steps?

    Thanks

    Simon

    Trevor
    #199771

    If you edit one of the posts, in the admin editor, in the top of the page (on the right under the user name in the admin bar), you will see a options slide down panel. Click options to open it:

    https://www.screencast.com/t/P27StRRzV

    and the select the and close the panel:

    https://www.screencast.com/t/Edq14nRX

    And then you will have this:

    https://www.screencast.com/t/Edq14nRX

    Excerpts take only plain text.

    Anonymous
    #199780

    I’m using pages for the results, not posts, so the excerpt isn’t available to me.

    I have a blank functions file in my child theme. I read that I can add this to enable excerpts in pages:

    add_post_type_support( ‘page’, ‘excerpt’ );

    However, this is not working, I suspect because it’s in the blank child theme functions.php and needs more code to work.

    Trevor
    #199785

    Did your functions.php code look like this?

    add_action( 'init', 'my_add_excerpts_to_pages' );
    function my_add_excerpts_to_pages() {
        add_post_type_support( 'page', 'excerpt' );
    }

    If it is a child theme, then the functions.php will be empty until you add something, although line #1 should be (so add the code to line 2):

    <?php

    There is no closing PHP tag at the end of the file BTW.

    Anonymous
    #199789

    That worked and the excerpts are being pulled through to the results page. Thanks so much!

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