This user has no favorite topics.
Favorite Forum Topics
Forum Topics Created
Status |
Topic
|
Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Remove title from translation only for custom post type
Started by: panagiotisE
in: English Support
Problem: Solution: add_filter( 'icl_job_elements', 'filter_title_for_events_only', 10, 2 );<br />function filter_title_for_events_only( $fields, $post_id ) {<br /> // Check if the post type is 'event'<br /> if ( 'event' === get_post_type( $post_id ) ) {<br /> foreach ( $fields as $field => $value ) {<br /> if ( $value->field_type == "title" ) {<br /> $value->field_translate = 0;<br /> $value->field_data_translated = $value->field_data;<br /> }<br /> }<br /> }<br /> return $fields;<br />} This code snippet should be added to the theme's functions.php file or a custom plugin. It ensures that the filter is only applied to the title fields of posts with the custom post type "event". Please note that this solution might be outdated or not applicable to your case. If it doesn't solve your issue, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please open a new support ticket. |
2 | 6 | 9 months, 2 weeks ago |