Hallo,
ich nutze für meine Kategorien den Befehl the_excerpt, um eine Vorschau des Inhaltes anzeigen zu lassen.
In der functions.php habe ich folgenden Code ergänzt:
/**
* Sets the post excerpt length to 40 characters.
*
* To override this length in a child theme, remove the filter and add your own
* function tied to the excerpt_length filter hook.
*
* @since ads 1.0
* @return int
*/
function ads_excerpt_length( $length ) {
return 40;
}
add_filter( 'excerpt_length', 'ads_excerpt_length' );
/**
* Returns a "Continue Reading" link for excerpts
*
* @since ads 1.0
* @return string "Continue Reading" link
*/
function ads_continue_reading_link() {
return ' <a href="'. get_permalink() . '">Den ganzen Artikel lesen </a>';
}
/**
* Replaces "[...]" (appended to automatically generated excerpts) with an ellipsis and ads_continue_reading_link().
*
* To override this in a child theme, remove the filter and add your own
* function tied to the excerpt_more filter hook.
*
* @since ads 1.0
* @return string An ellipsis
*/
function ads_auto_excerpt_more( $more ) {
return ' …' . ads_continue_reading_link();
}
add_filter( 'excerpt_more', 'ads_auto_excerpt_more' );
/**
* Adds a pretty "Continue Reading" link to custom post excerpts.
*
* To override this link in a child theme, remove the filter and add your own
* function tied to the get_the_excerpt filter hook.
*
* @since ads 1.0
* @return string Excerpt with a pretty "Continue Reading" link
*/
function ads_custom_excerpt_more( $output ) {
if ( has_excerpt() && ! is_attachment() ) {
$output .= ads_continue_reading_link();
}
return $output;
}
add_filter( 'get_the_excerpt', 'ads_custom_excerpt_more' );
Alles anzeigen
Das funktioniert auch alles wunderbar.
Wie ich nun feststellen musste, funktioniert der "More-Tag" in Beiträgen nun aber nicht mehr. Ist es möglich, diesesn auch zu nutzen?
Was habe ich hierfür anzupassen?
Vielen Dank!