Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1101939
    christiaanakkermans
    Participant

    Hi,

    I want te change the ‘Read More’ link to my posts in my blog. I looked in the forum and found this code for in the childtheme:

    if ( ! function_exists( ‘x_excerpt_string’ ) ) :
    function x_excerpt_string( $more ) {

    $stack = x_get_stack();

    if ( $stack == ‘integrity’ ) {
    return ‘ … <div>‘ . __( ‘Read More’, ‘__x__’ ) . ‘</div>’;
    } else if ( $stack == ‘renew’ ) {
    return ‘ … ‘ . __( ‘Read More’, ‘__x__’ ) . ‘‘;
    } else if ( $stack == ‘icon’ ) {
    return ‘ …’;
    } else if ( $stack == ‘ethos’ ) {
    return ‘ …’;
    }

    }
    add_filter( ‘excerpt_more’, ‘x_excerpt_string’ );
    endif;

    But now My website gives this parse error:
    Parse error: syntax error, unexpected end of file in /home/content/n3pnexwpnas01_data03/22/2667122/html/wp-content/themes/x-child/functions.php on line 56

    1. Can you please solve the parse error for me (and explain me what I am doing wrong)?
    2. Can you correct the code for me, so the ‘Read More’ link changes to ‘Lees Meer’?

    Thanks in advance.

    Christiaan

    #1101945
    christiaanakkermans
    Participant
    This reply has been marked as private.
    #1101955
    Thai
    Moderator

    Hi There,

    I’ve just fixed the issue.

    You forgot to add the endif; in your functions.php file.

    The correct code should be:

    if ( ! function_exists( 'x_integrity_entry_meta' ) ) :
      
    function x_integrity_entry_meta() {
      //Nothing here
    }
    
    endif;
    
    if ( ! function_exists( 'x_excerpt_string' ) ) :
      function x_excerpt_string( $more ) {
        
        $stack = x_get_stack();
    
        if ( $stack == 'integrity' ) {
          return ' ... <div><a href="' . get_permalink() . '" class="more-link">' . __( 'Lees Meer', '__x__' ) . '</a></div>';
        } else if ( $stack == 'renew' ) {
          return ' ... <a href="' . get_permalink() . '" class="more-link">' . __( 'Lees Meer', '__x__' ) . '</a>';
        } else if ( $stack == 'icon' ) {
          return ' ...';
        } else if ( $stack == 'ethos' ) {
          return ' ...';
        }
    
      }
      add_filter( 'excerpt_more', 'x_excerpt_string' );
    endif;

    Cheers!

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