What value should I insert in code
-
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)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘What value should I insert in code’ is closed to new replies.