Archived topic
Load more button not working on post category pages
5 replies · Started by marketingeszkozok on May 12, 2020
Hi there,
Are you referring to the read more button not showing?
If so it looks like you are using the custom excerpt metabox:
https://www.wpbeginner.com/plugins/how-to-customize-wordpress-excerpts-no-coding-required/
So this code is needed:
https://docs.generatepress.com/article/activating-read-custom-excerpt/
Hi Leo,
Activated: https://wordpress.org/plugins/advanced-excerpt/
I pasted:
https://share.getcloudapp.com/7Ku0W7A7
Not displayed well:
https://share.getcloudapp.com/X6uO7gRj
Attila
You don't need that plugin.
The excerpt metabox comes default with WordPress:
https://www.screencast.com/t/w520Lm0XYQM
The code needs to be added using one of these methods below and not a hook:
https://docs.generatepress.com/article/adding-php/
ADDING THIS:
add_filter( 'wp_trim_excerpt', 'tu_excerpt_metabox_more' );
function tu_excerpt_metabox_more( $excerpt ) {
$output = $excerpt;
if ( has_excerpt() ) {
$output = sprintf( '%1$s <p class="read-more-button-container">%3$s</p>',
$excerpt,
get_permalink(),
__( 'Read more', 'generatepress' )
);
}
return $output;
}
THE RESULT IS:
The snippet has been deactivated due to an error on line 3:
Cannot redeclare function tu_excerpt_metabox_more.
I have a problem in JP langage:
https://farmamondo2020.factorybank.it/ja/category/farmamondo-news-ja/corporate-news-ja/
EXCERPT Work fine:
https://farmamondo2020.factorybank.it/category/farmamondo-news/corporate-news/
https://farmamondo2020.factorybank.it/ru/category/farmamondo-news-ru/corporate-news-ru/
https://farmamondo2020.factorybank.it/es/category/farmamondo-news-es/corporate-news-es/
In RU EN ES experpt work fine in JP no !?
And the BT read more ... nothing
That error means that PHP function is already added to the site somewhere.
I answered the excerpt issue here: https://generatepress.com/forums/topic/error-except-in-jp-language/#post-1284556
Thanks!