• Hi,

    Last thing I would like to customize is the text of the more-link that appears in seach results, currently it reads ‘(more…)’, which I would like to change into ‘Read more’ and an arrow.

    I can’t find this text nowhere. I’ve looked in every php file from content to theme functions.

    Any idea how I could proceed?

    Thank you so much for the help,
    v.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi there!

    I checked out your posts and saw you have the “Read More –>” you asked about working now, so looks like you’ve figured it out! ?? In case you need it in the future, here’s the page in the codex with info on making that change: https://codex.www.ads-software.com/Customizing_the_Read_More

    Also, I noticed you’re not currently using a child theme when making these tweaks, so I wanted to mention the importance of using one. Each time you update the theme, changes like these will be lost. Keeping your theme up-to-date is important for security reasons, so a child theme would allow you to update and also keep your changes in place too. If you haven’t made one before, there’s some information on it here:
    https://codex.www.ads-software.com/Child_Themes

    This post is helpful too:
    https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

    While looking at your site, I noticed you had a copyright protection script running, which limits our ability to use our tools to check things out, so in the future, if you can disable that when asking questions that may require us to dig around, that would be helpful. (Also, copyright protection like that isn’t great at protecting content, so you may want to consider other protections, such as watermarking your images if you’re worried about those, rather than relying on the blocked right click.)

    Let us know if you have any more questions!

    Thread Starter vikou1008

    (@vikou1008)

    Hi,

    No this is absolutely not resolved.

    The text that I specifically want to change is the more-link, which appears within posts after a search in RESEARCH RESULTS ONLY, which currently appears as ‘(more…)’.

    Anywhere else I’ve indeed figured out how to change the more-link into my ‘read more’ with an arrow, just not in the SEARCH RESULTS.

    Any idea?

    Thank you ??

    Ah, sorry about that! I missed “search” on the re-read once I saw it on your site and thought the right one had been changed.

    Due to the copyright script blocking right click on your site, I’m unable to inspect it in particular (and it appears to have a customization in this area already, since it’s not showing the theme’s default […] there).

    However, I have a solution that works on the Ryu theme as-is , so perhaps it will work for you or you can adjust it to fit in with what you’ve already got to get it working.

    In functions.php add the following:

    /* add read more link to end of excerpt in search results */
    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'your-text-domain') . '</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );
    Thread Starter vikou1008

    (@vikou1008)

    Hi,

    Thank you for your answer.

    I’ve deactivated my copyright protection for now, so the right click is possible again.

    I’ve tried the code you suggested, but it didn’t change the ‘(more…)’ text of the more-link in search results.

    The only thing I’ve actually customized in the search results area is that I’ve asked for the full content to display instead of just an excerpt in the content.php file.

    <?php if ( is_search() ) : // Display full content for Search ?>
    		<div class="entry-content">
    			<?php the_content(); ?>
    		</div><!-- .entry-content -->

    I haven’t customized anything else in this area, since I can’t find the more-link text ‘(more…)’ of search results only anywhere in the php files, although I could change it anywhere else into ‘Read more’ and an arrow.

    Any thought?

    Thank you ??

    Hi! Thanks for deactivating the right click blocker so I can take a closer look. ??

    I think we may need to step back and start fresh in a few places to get your theme working as you would like it to… It seems like there are some conflicting changes that are preventing us from getting it setup just as you want.

    First, since you are making these edits in the Ryu theme directly, and not a child theme, the next time the theme updates, you will lose all of your changes, so a child theme would be a great benefit.

    To get this all sorted out, you could install a fresh copy of Ryu into your site, then setup a child theme using the instructions here: https://www.smashingmagazine.com/2016/01/create-customize-wordpress-child-theme/

    Then, once you have that in place, let’s take a look at the search result adjustments. The way Ryu displays search results by default is with a post excerpt and […] at the end of the text, like this example from the demo: https://cloudup.com/c9VqjOaxKe6

    To change this, you would need to decide if you want to show the entire post for every post listed in the results *or* use an excerpt and change the […] to something else (such as a Read More link, you’ve mentioned), since those two options won’t work together.

    Once you have the theme and child theme setup so that all of these changes won’t be lost, we can work through changing the […] to either option you’d like and get you moving from there. ??

    One more note — Before adding a new copy of the theme to your site to start fresh, you may want to save a copy of the existing theme files to use as a reference for adding parts of your previous work into your new child theme, as needed.

    If needed, here’s some information on doing that here:
    https://codex.www.ads-software.com/Backing_Up_Your_WordPress_Files

    Thread Starter vikou1008

    (@vikou1008)

    Hi,

    Thank you for your suggestion, but I actually found the solution, just adding this in the theme functions:

    add_filter( 'the_content_more_link', 'modify_read_more_link' );
    function modify_read_more_link() {
    return '<a class="more-link" href="' . get_permalink() . '">Read more &rarr;</a>';
    }

    If ever this helps anyone else.

    Best!

    Nice! Glad you got it sorted out. And thanks for sharing your solution! ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Change '(more…)' link in seach results’ is closed to new replies.