Last active
October 23, 2018 10:46
-
-
Save RiodeJaneiroo/1d361eddf3234d2b8823991ed2e5af25 to your computer and use it in GitHub Desktop.
[Lang site] #wordpress #polylang
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define('SITE_LANG', pll_current_language('slug')); | |
if (function_exists('pll_register_string')) { | |
pll_register_string('Chat with us', 'Discute avec nous', 'Theme'); | |
} | |
// for custom post type add lang | |
add_filter( 'pll_get_post_types', 'add_cpt_to_pll', 10, 2 ); | |
function add_cpt_to_pll( $post_types, $is_settings ) { | |
$post_types['portfolio'] = 'portfolio'; | |
return $post_types; | |
} | |
acf_add_options_page(array( | |
'page_title' => 'Site Options', | |
'menu_title' => 'Site Options', | |
'menu_slug' => 'theme-general-settings', | |
'capability' => 'edit_posts', | |
'post_id' => 'en', | |
'redirect' => false | |
)); | |
acf_add_options_sub_page( array( | |
'page_title' => 'Site Options (FR)', | |
'menu_title' => __('Site Options (FR)', 'text-domain'), | |
'menu_slug' => "site-options-fr", | |
'post_id' => 'fr', | |
'parent' => 'theme-general-settings' | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment