- This topic has 7 replies, 2 voices, and was last updated 3 years, 3 months ago by Tom.
-
AuthorPosts
-
June 28, 2019 at 2:50 am #943619d
1.
i installed the wp show post.
but how to translate the previous/next button(see pictur)?
https://prntscr.com/o7uuxj2. how to set widget title css like this(see picture)?
https://prntscr.com/o7uuxf3.what’s the function.php code(to disable the name and e-mail box in the comments)? see picture
https://prntscr.com/o7uxk9
Thanks!June 28, 2019 at 12:35 pm #944163TomLead DeveloperLead DeveloperHi there,
1. Translations can be made here: https://translate.wordpress.org/projects/wp-themes/generatepress/
Alternatively, you can use a function like this:
add_filter( 'gettext', function( $text ) { if ( 'Previous' === $text ) { $text = 'Your new text'; } if ( 'Next' === $text ) { $text = 'Your new text'; } return $text; } );
2. There are a couple of things you need to do here:
First, add this PHP:
add_filter( 'generate_start_widget_title', function() { return '<h2 class="widget-title"><span>'; } ); add_filter( 'generate_end_widget_title', function() { return '</span></h2>'; } );
Then, add this CSS:
.sidebar .widget .widget-title { border-bottom: 1px solid red; padding: 10px 0; } .sidebar .widget .widget-title span { background: red; color: #fff; padding: 10px; }
3. Not sure if that will work, but you can try:
add_filter( 'comment_form_default_fields', function( $fields ) { unset( $fields['author'] ); unset( $fields['email'] ); return $fields; }, 50 );
June 29, 2019 at 8:53 am #944705dThanks. Tom
but the 1st code isn’t work.
maybe,because need to translate the wp-show-post plugin.
(when I install Loco Translate plugin to translate the text,but there isn’t .pot file)Source files to scan: 54 (194.6 KB on disk, largest is 29.6 KB) Strings will be extracted to: plugins/wp-show-posts/wp-show-posts.pot
the “previous”,”next” is outputed by the wp-show-post plugin code.
so, is there anyway to solve it?
https://prntscr.com/o7uuxjJune 29, 2019 at 9:06 am #944715TomLead DeveloperLead DeveloperAh, in that case, you would do this:
add_filter( 'gettext', function( $text ) { if ( '← Previous' === $text ) { $text = 'Your new text'; } if ( 'Next →' === $text ) { $text = 'Your new text'; } return $text; } );
June 29, 2019 at 6:47 pm #944970dThanks.Tom
it is workJune 30, 2019 at 9:25 am #945381TomLead DeveloperLead DeveloperYou’re welcome 🙂
January 12, 2021 at 3:29 am #1615454MarekHi there I have a similar problem. I tried to follow the solutions presented in this thread but I was not able to make it work. My site is http://www.finfin.sk
I would like to translate Previous / Next navigation in the Blog.
I can see that this translation is missing in the Generatepress https://translate.wordpress.org/projects/wp-themes/generatepress/
So I have translated it and added it.
https://prnt.sc/wlqnprCould you please upload the translation? So it will show across all GP websites written in Slovak language?
January 12, 2021 at 10:18 am #1616109TomLead DeveloperLead DeveloperHi there,
Any chance you can open a new topic? This one was WP Show Posts specific.
Thanks!
-
AuthorPosts
- You must be logged in to reply to this topic.