Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #995770
    cstarrduke
    Participant

    Hello!

    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

    #995851
    Rahul
    Moderator

    Hey 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.

    #995976
    cstarrduke
    Participant

    Thank 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.

    #996202
    Darshana
    Moderator

    Hi 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.

    #997497
    cstarrduke
    Participant

    Hello!

    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!

    #997500
    cstarrduke
    Participant
    This reply has been marked as private.
    #997621
    Thai
    Moderator

    Hi 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!

    #997694
    cstarrduke
    Participant

    Great–thank you. Any suggestions for the search results?

    #997901
    Rupok
    Member

    You 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

  • <script> jQuery(function($){ $("#no-reply-995770 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>