Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1053379
    Lely
    Moderator
    This reply has been marked as private.
    #1053822
    Pbalazs89
    Participant
    This reply has been marked as private.
    #1054931
    Rad
    Moderator

    Hi there,

    I have exactly the same setting as your screenshot, and it’s not working.

    Though, Cpanel’s file manager should be okay now. I confirmed that it works when language URL structure is set to ?lang=en.

    Would you mind installing a child theme first? It’s recommended for testing and applying the custom code.

    Thanks!

    #1057656
    Pbalazs89
    Participant

    Hi,

    I installed the child theme. Unfortunately it doesn’t fix the issue.

    Thanks!

    #1057728
    Rad
    Moderator
    This reply has been marked as private.
    #1057749
    Pbalazs89
    Participant
    This reply has been marked as private.
    #1058585
    Rad
    Moderator

    Hi there,

    Found it, please create this file into your child theme

    /wp-content/themes/x-child/framework/views/global/_portfolio.php

    On that file, please add this content,

    <?php
    
    // =============================================================================
    // VIEWS/GLOBAL/_PORTFOLIO.PHP
    // -----------------------------------------------------------------------------
    // Includes the portfolio output.
    // =============================================================================
    
    $stack    = x_get_stack();
    $entry_id = get_the_ID();
    
      global $sitepress;
    
      if ( function_exists( 'icl_object_id' ) && is_callable( array( $sitepress, 'get_current_language' ) ) ) {
          $wpml_post = get_post( icl_object_id( $entry_id, 'page', false, $sitepress->get_current_language() ) );
          $entry_id = $wpml_post->ID;
      }
    
    $paged    = ( is_front_page() ) ? get_query_var( 'page' ) : ( ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1 );
    $cols     = get_post_meta( $entry_id, '_x_portfolio_columns', true );
    $count    = get_post_meta( $entry_id, '_x_portfolio_posts_per_page', true );
    $filters  = get_post_meta( $entry_id, '_x_portfolio_category_filters', true );
    
    switch ( $cols ) {
      case 'One'   : $cols = 1; break;
      case 'Two'   : $cols = 2; break;
      case 'Three' : $cols = 3; break;
      case 'Four'  : $cols = 4; break;
    }
    
    ?>
    
    <?php x_get_view( 'global', '_script', 'isotope-portfolio' ); ?>
    
    <div id="x-iso-container" class="x-iso-container x-iso-container-portfolio cols-<?php echo $cols; ?>">
    
      <?php
    
      if ( count( $filters ) == 1 && in_array( 'All Categories', $filters ) ) {
    
        $args = array(
          'post_type'      => 'x-portfolio',
          'posts_per_page' => $count,
          'paged'          => $paged
        );
    
      } else {
    
        $args = array(
          'post_type'      => 'x-portfolio',
          'posts_per_page' => $count,
          'paged'          => $paged,
          'tax_query'      => array(
            array(
              'taxonomy' => 'portfolio-category',
              'field'    => 'term_id',
              'terms'    => $filters
            )
          )
        );
    
      }
    
      $wp_query = new WP_Query( $args );
    
      ?>
    
      <?php if ( $wp_query->have_posts() ) : ?>
        <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
          <?php if ( $stack != 'ethos' ) : ?>
            <?php x_get_view( $stack, 'content', 'portfolio' ); ?>
          <?php else : ?>
            <?php x_ethos_entry_cover( 'main-content' ); ?>
          <?php endif; ?>
        <?php endwhile; ?>
      <?php endif; ?>
    
    </div>
    
    <?php pagenavi(); ?>
    <?php wp_reset_query(); ?>

    That should fix it, and make sure that your portfolio home page and items has independent translation (not sync to their other language counterpart)

    Cheers!

    #1061119
    Pbalazs89
    Participant

    Hi there, I’ve done the steps and created a new english portfolio item to test it, but it still doesn’t show up.

    Any ideas?

    Thanks!

    #1062317
    Lely
    Moderator

    Hi There,

    You should also create a new portfolio index page. Both portfolio homepage and items should be independent as Rad previously suggested.

    Hope this helps.

    #1068127
    Pbalazs89
    Participant

    Thank you very much, I appreciate your help!

    Everything works fine now except one thing. If I’m on the portfolio page, the language switcher does not work. It works fine on all the other pages. Any idea as to why?

    Thanks!

    #1068831
    Rad
    Moderator

    Hi there,

    You created separate portfolio home page for each language. It’s wrong, you’re supposed to duplicate your original portfolio home page using WPML’s duplicate functionality, then switch edit the portfolio translated/duplicate page and click independent translation, it’s not the indepedent page but translation.

    Thanks!

    #1144375
    Pbalazs89
    Participant

    Hi there,

    I’ve setup a site, and would like to include the language switcher in the topbar on the right.

    I’ve added this code to the child theme’s _topbar.php file in frameworks / views / global

    ?>
    
    <?php if ( x_get_option( 'x_topbar_display', 0 ) == 1 ) : ?>
    
      <div class="x-topbar">
        <div class="x-topbar-inner x-container-fluid max width">
          <?php if ( x_get_option( 'x_topbar_content' ) != '' ) : ?>
          <p class="p-info"><?php echo x_get_option( 'x_topbar_content' ); ?></p>
          <?php endif; ?>
          <?php x_social_global(); ?>
          <div class="wpml-selector"><?php do_action('icl_language_selector'); ?></div>
        </div>
      </div>
    
    <?php endif; ?>

    Other than that I’ve added some CSS so the DIV should float:right;, but the language selector does not seem to appear. Any ideas why this might be?

    Ohh yeah, the url is http://decorolux2.decorolux.com

    #1145405
    Rad
    Moderator

    Hi there,

    Your child theme is not active, you should activate it first before testing.

    Thanks!

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