[Resolved] how to translate the previous/next button(wp show post)

Home Forums Support [Resolved] how to translate the previous/next button(wp show post)

Home Forums Support how to translate the previous/next button(wp show post)

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #943619
    d

    1.
    i installed the wp show post.
    but how to translate the previous/next button(see pictur)?
    https://prntscr.com/o7uuxj

    2. how to set widget title css like this(see picture)?
    https://prntscr.com/o7uuxf

    3.what’s the function.php code(to disable the name and e-mail box in the comments)? see picture
    https://prntscr.com/o7uxk9
    Thanks!

    #944163
    Tom
    Lead Developer
    Lead Developer

    Hi 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 );
    #944705
    d

    Thanks. 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/o7uuxj

    #944715
    Tom
    Lead Developer
    Lead Developer

    Ah, in that case, you would do this:

    add_filter( 'gettext', function( $text ) {
        if ( '&larr; Previous' === $text ) {
            $text = 'Your new text';
        }
    
        if ( 'Next &rarr;' === $text ) {
            $text = 'Your new text';
        }
    
        return $text;
    } );
    #944970
    d

    Thanks.Tom
    it is work

    #945381
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

    #1615454
    Marek

    Hi 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/wlqnpr

    Could you please upload the translation? So it will show across all GP websites written in Slovak language?

    #1616109
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Any chance you can open a new topic? This one was WP Show Posts specific.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.