Tagged: x
-
AuthorPosts
-
May 17, 2016 at 11:42 am #995770
cstarrdukeParticipantHello!
I am hoping to make a small change to the search results page. As of now, the search results are links to pages on the site that include my searched word. I am hoping that instead of only the page hyperlink I could also add below it a small part of that page where this keyword is mentioned. Right now, if the user goes to that page, they have no idea where that searched word is.
I am using X Theme version 4.4.2, WordPress version 4.5.2 and Cornerstone version 1.2.4. This site is under construction now and cannot be viewed without logging in.
Thank you,
Jillian
May 17, 2016 at 12:22 pm #995851
RahulModeratorHey there,
Thanks for writing in! To assist you with this request, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
May 17, 2016 at 1:46 pm #995976
cstarrdukeParticipantThank you for responding so quickly! The URL is: http://www.cstarr.org/?s=skinner. This site isn’t live yet, so I’m not sure you’ll be able to see the page.
May 17, 2016 at 4:42 pm #996202
DarshanaModeratorHi there,
Your site is under construction mode. However if I understood correctly, you want to add the Search Keyword to the search results page. Please follow the instructions below.
Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.
As you’re using Renew stack currently, copy the file _landmark-header.php file which is located under your themes folder (“/x/framework/views/renew/_landmark-header.php“) into your child theme’s respective location (“/x-child/framework/views/renew/_landmark-header.php”).
Then Edit the file using a Text Editor (Notepad/Notepad++) and then locate the following code near the line no 53.
<?php elseif ( is_search() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?></span></h1>Then you can replace it as follows to include the search term.
<?php elseif ( is_search() ) : ?> <h1 class="h-landmark"><span><?php _e( 'Search Results', '__x__' ); ?> for the keyword: "<?php the_search_query(); ?>"</span></h1>Finally, you can save the changes and check your search results page.
Hope that helps.
May 18, 2016 at 9:53 am #997497
cstarrdukeParticipantHello!
Thank you so much for your response.
In the top right corner, the page already has “Search Results for X.” I meant to ask how I can add more detail on where this keyword is found. Right now, for example, when I search for “Skinner,” search results show the two pages “Skinner” is found on. However, those pages have a lot of text. I am hoping to add some text on the search results page under the pages “Skinner” is found on to somehow show where on those pages this keyword is found.
Let me know if it would be easier to log in and see.
Thank you for your help!
May 18, 2016 at 9:57 am #997500
cstarrdukeParticipantThis reply has been marked as private.May 18, 2016 at 11:15 am #997621
ThaiModeratorHi There,
The child theme is needed to set up when you want to edit the theme templates.
Your custom CSS will be safe under Customizer > Custom > Global CSS.
Regards!
May 18, 2016 at 11:48 am #997694
cstarrdukeParticipantGreat–thank you. Any suggestions for the search results?
May 18, 2016 at 1:43 pm #997901
RupokMemberYou are welcome! If you want to change the default behavior of search result page then it would be unusual and unfortunately we can’t assist on this much.
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-995770 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
