• Resolved maxxdesign

    (@maxxdesign)


    I use the Ego theme and Polylang recognize the Portfolios cpt, but the Homepage Slides and Homepage Sections were not visible in the plugin admin. So I added this code

    add_filter(‘pll_get_post_types’, ‘my_pll_get_post_types’);
    function my_pll_get_post_types($types) {
    return array_merge($types, array( ‘Homepage Slides’ => ‘Homepage Slides’, ‘Homepage Sections’ => ‘Homepage Sections’));
    }
    Now I see two new checkboxes in the admin but without label and the cpt have no more the language box in the edit section.
    Any suggestion?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter maxxdesign

    (@maxxdesign)

    Ok solved by myself

    The right code is below

    add_filter(‘pll_get_post_types’, ‘my_pll_get_post_types’);
    function my_pll_get_post_types($types) {
    return array_merge($types, array( ‘udt_homepage_slider’ => ‘udt_homepage_slider’, ‘udt_homepage_secs’ => ‘udt_homepage_secs’));
    }

    I used the name in the previous array but the code works using the theme slug for the cpt

    Thread Starter maxxdesign

    (@maxxdesign)

    What I named slug is really the cpt as named in the register function

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Polylang and CPT’ is closed to new replies.