Bỏ qua điều hướng

Waiting for author

Topic Tags: Compatibility

Overview of the issue

When using the Houzez theme, you might experience the following issue: translated properties do not retain their agent assignment, causing the translated agent profiles to display zero properties. This occurs because the agent field (fave_agents) does not correctly link to the translated agent post.

Workaround

Please, make sure of having a full site backup of your site before proceeding.

1. Set the translation preference

  • Go to “WPML > Settings > Custom fields translation”
  • Set the translation preference of the custom field fave_agents to COPY

2. Adjust agent ID handling in theme functions

  • Open the …/wp-content/themes/houzez/framework/functions/property_functions.php file.
  • Look for line 3663 (houzez_get_property_agent function).
  • Replace:
    $agent_id = intval( $agent );
            
  • With:
    $agent_id = intval( $agent );
    // WPML Workaround for compsupp-7949 
    $agent_id = apply_filters( 'wpml_object_id', $agent_id, 'houzez_agent', TRUE ); 
            
  • Look for line 3738 (houzez20_get_property_agent function).
  • Replace:
    $agent_id = intval( $agent_id );
            
  • With:
    $agent_id = intval( $agent_id );
    // WPML Workaround for compsupp-7949 
    $agent_id = apply_filters( 'wpml_object_id', $agent_id, 'houzez_agent', TRUE ); 
            

3. Ensure agent profile lists the correct properties

  • Open the …/wp-content/themes/houzez/framework/classes/Houzez_Query.php file.
  • Look for line 718 (loop_agent_properties function).
  • Replace:
    $agent_id = get_the_ID();
            
  • With:
    $agent_id = get_the_ID();
    // WPML Workaround for compsupp-7949 
    $default_lang = apply_filters('wpml_default_language', NULL );  
    $agent_id = apply_filters( 'wpml_object_id', $agent_id, 'houzez_agent', TRUE,  $default_lang ); 
            

Để lại phản hồi

Vui lòng bám sát chủ đề và tôn trọng người khác. Nếu bạn cần trợ giúp với các vấn đề không liên quan đến bài đăng này, hãy sử dụng Diễn đàn Hỗ trợ của chúng tôi để bắt đầu trò chuyện hoặc gửi yêu cầu hỗ trợ.

Bạn có thể sử dụng các thẻ sau:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>