Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1275563
    kopaysages-gd
    Participant

    http://www.kopaysages.com/
    WordPress 4.6.1
    X – Child Theme
    X – Integrity Version : 4.6.4
    CodeStyling Localization Version 1.99.30

    Hi!
    With CodeStyling Localization I translated Permalink to:
    to Permalien vers : (fr_CA)

    It’s O.K. on all pages (ex.: http://www.kopaysages.com/portfolio/projets/ ) but not on home page
    as alt text (hover) on the 9 images under Projets, Thèmes and Blogue.

    Thanks for your help!

    Gilles

    #1275606
    Rupok
    Member

    Hi there,

    Kindly review our Translation guide for all available options that works fine.

    Cheers!

    #1290589
    kopaysages-gd
    Participant

    Hi!

    Read that, done that 😉
    and still the same problem

    http://www.kopaysages.com/
    WordPress 4.7
    X – Child Theme
    X – Integrity Version : 4.6.4
    CodeStyling Localization Version 1.99.30

    #1290875
    Christopher
    Moderator

    Hi there,

    Please add following code in child theme’s functions.php file :

    // =============================================================================
    function x_shortcode_recent_posts_v2code( $atts ) {
      extract( shortcode_atts( array(
        'id'          => '',
        'class'       => '',
        'style'       => '',
        'type'        => '',
        'count'       => '',
        'category'    => '',
        'enable_excerpt' => '',
        'offset'      => '',
        'orientation' => '',
        'no_image'    => '',
        'fade'        => ''
      ), $atts ) );
    
      $id            = ( $id          != ''          ) ? 'id="' . esc_attr( $id ) . '"' : '';
      $class         = ( $class       != ''          ) ? 'x-recent-posts cf ' . esc_attr( $class ) : 'x-recent-posts cf';
      $style         = ( $style       != ''          ) ? 'style="' . $style . '"' : '';
      $type          = ( $type        == 'portfolio' ) ? 'x-portfolio' : 'post';
      $count         = ( $count       != ''          ) ? $count : 3;
      $category      = ( $category    != ''          ) ? $category : '';
      $category_type = ( $type        == 'post'      ) ? 'category_name' : 'portfolio-category';
      $offset        = ( $offset      != ''          ) ? $offset : 0;
      $orientation   = ( $orientation != ''          ) ? ' ' . $orientation : ' horizontal';
      $no_image      = ( $no_image    == 'true'      ) ? $no_image : '';
      $fade          = ( $fade        == 'true'      ) ? $fade : 'false';
      $enable_excerpt = ( $enable_excerpt == 'true'      ) ? true : false;
    
      $output = "<div {$id} class=\"{$class}{$orientation}\" {$style} data-fade=\"{$fade}\">";
    
        $q = new WP_Query( array(
          'orderby'          => 'date',
          'post_type'        => "{$type}",
          'posts_per_page'   => "{$count}",
          'offset'           => "{$offset}",
          "{$category_type}" => "{$category}"
        ) );
    
        if ( $q->have_posts() ) : while ( $q->have_posts() ) : $q->the_post();
    
          if ( $no_image == 'true' ) {
            $image_output       = '';
            $image_output_class = 'no-image';
          } else {
            $image_output       = '<div class="x-recent-posts-img">' . get_the_post_thumbnail( get_the_ID(), 'entry-' . get_theme_mod( 'x_stack' ) . '-cropped', NULL ) . '</div>';
            $image_output_class = 'with-image';
          }
    
          $output .= '<a class="x-recent-post' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalien vers: "%s"', '__x__' ), the_title_attribute( 'echo=0' ) ) ) . '">'
                     . '<article id="post-' . get_the_ID() . '" class="' . implode( ' ', get_post_class() ) . '">'
                       . '<div class="entry-wrap">'
                         . $image_output
                         . '<div class="x-recent-posts-content">'
                           . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
                           . '<span class="x-recent-posts-date">' . get_the_date() . '</span>'
                          // . ( $enable_excerpt ? '<span class="x-recent-posts-excerpt">' . strip_tags( get_the_excerpt() ) . '</span>' : '' )
                           //.'<div>' . __( 'Read More', '__x__' ) .'</div>'
                         . '</div>'
                       . '</div>'
                     . '</article>'
                   . '</a>';
    
        endwhile; endif; wp_reset_postdata();
      
      $output .= '</div>';
    
      return $output;
    }
    
    add_action('wp_head', 'change_recent_posts_to_v2');
    
    function change_recent_posts_to_v2() {
      remove_shortcode( 'x_recent_posts' );
      add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2code' );
    }

    Hope it helps.

    #1292418
    kopaysages-gd
    Participant

    Help!

    Added the code and now BLANK pages
    on admin side AND on the site side

    #1292431
    Christopher
    Moderator

    Hi there,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Thanks.

    #1292441
    kopaysages-gd
    Participant
    This reply has been marked as private.
    #1292469
    Christopher
    Moderator

    Hi there,

    Upon checking your host files, you added part of code in functions.php file, I fixed it for you. Please clear cache and check again.

    Hope it helps.

    #1292484
    kopaysages-gd
    Participant

    Hi again!

    Thank you very much for that.
    Admin and site are up.

    But we still have the same translation problem on home page 🙁

    #1292529
    Christopher
    Moderator

    Hi there,

    Please add following code in Customize -> Custom -> Global JavaScript :

    jQuery('.entry-thumb').each(function(e){
        var title = jQuery(this).attr('title');
        jQuery(this).hover(function() {
          jQuery(this).attr('title', title.replace('Permalink to: ', 'Permalien vers: '));
        });
      });

    Hope that helps.

    #1293779
    kopaysages-gd
    Participant

    Hi Christopher!

    Done that and…
    it’s not working

    #1293842
    Rue Nel
    Moderator

    Hello There,

    Sorry if it didn’t work out. Since you already have your child theme active and ready, please insert this following code in your child theme’s functions.php file.

    // Change Permalent To
    // =============================================================================
    function change_permalink_to($translated) { 
      $translated = str_ireplace('Permalink to: ', 'Permalien vers: ', $translated);
      return $translated; 
    }
    add_filter('gettext', 'change_permalink_to' );
    // =============================================================================

    Hope this helps. Kindly let us know.

    #1295165
    kopaysages-gd
    Participant

    YESSS!
    It’s working. THANK YOU!

    I inserted your code under Christopher’s code first response
    (#1290875). Is this O.K.? Do I have to cut Christopher’s code?

    On other pages, I have Permalien vers : « —– »
    on home page, I have Permalien vers : “—–”
    Is there a way to replace “—–” by « —– » ?

    Thank you very much for your help with this.

    #1295212
    Rue Nel
    Moderator

    Hello There,

    Thanks for updating us in! Glad it works out for you. You can update the code to replace the arrows. maybe you can make use of this code instead:

    // Change Permalent To
    // =============================================================================
    function change_permalink_to($translated) { 
      $translated = str_ireplace('Permalink to: "%s"', 'Permalien vers: "%s"', $translated);
      return $translated; 
    }
    add_filter('gettext', 'change_permalink_to' );
    // =============================================================================

    Hope this helps.

    #1296043
    kopaysages-gd
    Participant

    Hi!

    You understood me wrong. My wish was to replace ” ” by « ».
    But I update the code like this and it worked.

    // =============================================================================
    function change_permalink_to($translated) {
    $translated = str_ireplace(‘Permalink to: “%s”‘, ‘Permalien vers : « %s »‘, $translated);
    return $translated;
    }
    add_filter(‘gettext’, ‘change_permalink_to’ );
    // =============================================================================

    Thanks a lot for your precious help!

  • <script> jQuery(function($){ $("#no-reply-1275563 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>