• Hi there,
    The theme I use for http://www.bootjesgek.nl is old and should be renewed. To do so I am building a child of Magazine Basic under the name of Magazine-Compact. To match the styling of the old theme I would like to remove the styling of the excerpts as given in the functions.php of the parent theme by adding some lines to the functions.php of the child theme. The effect that I want can be achieved by deactivating lines 459-530 in the parent functions.php but I have trouble to find out what lines to put in the child’s functions.php to get the wanted effect and I hope to find help here. These are the lines that should be inactivated:

    add_filter( 'excerpt_more', 'mb_excerpt' );
    if ( ! function_exists( 'mb_excerpt' ) ) :
    /**
     * Adds a read more link to all excerpts
     *
     * This function is attached to the 'excerpt_more' filter hook.
     *
     * @param	int $more
     *
     * @return	Custom excerpt ending
     *
     * @since 3.0.0
     */
    function mb_excerpt( $more ) {
    	return '…';
    }
    endif; // mb_excerpt
    
    add_filter( 'wp_trim_excerpt', 'mb_excerpt_more' );
    if ( ! function_exists( 'mb_excerpt_more' ) ) :
    /**
     * Adds a read more link to all excerpts
     *
     * This function is attached to the 'wp_trim_excerpt' filter hook.
     *
     * @param	string $text
     *
     * @return	Custom read more link
     *
     * @since 3.0.0
     */
    function mb_excerpt_more( $text ) {
    	return $text . '<p class="more-link-p"><a class="more-link" href="' . get_permalink( get_the_ID() ) . '">' . __( 'Read more &rarr;', 'magazine-basic' ) . '</a></p>';
    }
    endif; // mb_excerpt_more
    
    add_filter( 'the_content_more_link', 'mb_content_more_link', 10, 2 );
    if ( ! function_exists( 'mb_content_more_link' ) ) :
    /**
     * Customize read more link for content
     *
     * This function is attached to the 'the_content_more_link' filter hook.
     *
     * @param	string $link
     * @param	string $text
     *
     * @return	Custom read more link
     *
     * @since 3.0.0
     */
    function mb_content_more_link( $link, $text ) {
    	return '<p class="more-link-p"><a class="more-link" href="' . get_permalink( get_the_ID() ) . '">' . $text . '</a></p>';
    }
    endif; // mb_content_more_link
    
    add_filter( 'excerpt_length', 'mb_excerpt_length', 999 );
    if ( ! function_exists( 'mb_excerpt_length' ) ) :
    /**
     * Custom excerpt length
     *
     * This function is attached to the 'excerpt_length' filter hook.
     *
     * @param	int $length
     *
     * @return	Custom excerpt length
     *
     * @since 3.0.0
     */
    function mb_excerpt_length( $length ) {
    	return 40;
    }
    endif; // mb_excerpt_length

  • The topic ‘Remove styling readmore link and excerpt length Magazine Basic’ is closed to new replies.