• Resolved xCelestialx

    (@samvel45)


    Hello Guys. I just got code from Relevanssi support to make it work proper with polylang.

    add_filter( 'relevanssi_content_to_index', 'rlv_polylang_sync', 10, 2 );
    function rlv_polylang_sync( $content, $post ) {
      $language = pll_current_language() === 'en' ? 'fi' : 'en';
      $translated_post_id = pll_get_post( $post->ID, $language );
      if ( $translated_post_id ) {
        $translated_post = get_post( $translated_post_id );
        $content        .= ' ' . $translated_post->post_content;
        $content        .= ' ' . $translated_post->post_title;
      }
      return $content;
    }

    So how value will look like if I want to add row ` $content .= ‘ ‘ . $translated_post->post_title; to make code count some custom fields and replace post_title with that value(the custom field ID is ‘occupation’). Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Anh Tran

    (@rilwis)

    Hi @samvel45 ,

    Would you mind asking Relevanssi team for help? I’m not clear about your issue and you were asking Relevanssi before, so it’s best to ask them to continue to support.

    Thread Starter xCelestialx

    (@samvel45)

    Thanks for attention. Maybe you dont got question right.The thing is I ask for meta box value. For example post_title is core wordpress value to call post title. So I ask what is metabox plugin’s call value. Is it get_rwmb or what is that? There is nothing related to relevanssi in this question, I just ask is there any default field key,value or something like post_title or post_excerpt in metabox, but for certain field.

    Plugin Author Anh Tran

    (@rilwis)

    If you want to get value of custom fields created by Meta Box, please see this docs:

    https://docs.metabox.io/displaying-fields-with-code/

    Thread Starter xCelestialx

    (@samvel45)

    Thanks. According to this link rwmb_meta should work, but it doesnt. Adding id to that not only dont work, but disables search indexing. Maybe there is other key similar to that that can work?

    Plugin Author Anh Tran

    (@rilwis)

    Using rwmb_meta() is correct. I guess it depends on what field you want to get data for and for what post.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘What value should I insert in code’ is closed to new replies.