Functies deactiveren in child theme
-
Het Theme van Bootjesgek.nl is verouderd. De vormgeving is nog steeds okee, maar we kunnen niet meer updaten zonder een reeks foutmeldingen; het thema bevat verouderde functies. Ik heb gekozen voor het bewerken van Magazine Basic door middel van een Child Theme en dat lukt aardig maar er zijn een aantal regels in de functions.php van het Parent Theme die ik zou willen deactiveren in het Child Theme en dat wil maar niet lukken. De vraag is dus: wat moet ik in functions.php van het Child Theme opnemen om te zorgen dat onderstaande regels buiten werking worden gesteld? Het gaat (voorlopig) goed als ik in de Parent Theme de volgende regels van ‘comment’ voorzie: //459 t.e.m. //530:
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 href="' . get_permalink( get_the_ID() ) . '">' . __( 'Read more →', '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 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
- Het onderwerp ‘Functies deactiveren in child theme’ is gesloten voor nieuwe reacties.