Forums › Forums › Search & Filter Pro › Choose which text show in the results excerpt
- This topic has 6 replies, 2 voices, and was last updated 6 years, 1 month ago by
Anonymous.
-
Anonymous(Private) January 22, 2019 at 6:48 pm #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(Private) January 23, 2019 at 10:42 am #199759It 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.Trevor(Private) January 23, 2019 at 11:30 am #199771If 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(Private) January 23, 2019 at 12:02 pm #199780I’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(Private) January 23, 2019 at 12:06 pm #199785Did 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.
-
AuthorPosts