Tagged: x
-
AuthorPosts
-
July 25, 2016 at 9:50 am #1101939
christiaanakkermansParticipantHi,
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 561. 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
July 25, 2016 at 9:53 am #1101945
christiaanakkermansParticipantThis reply has been marked as private.July 25, 2016 at 9:58 am #1101955
ThaiModeratorHi 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!
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1101939 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
