The problem was actually the pages having “no language” and WPML seems to hate this.
So I just deleted all those pages and re-inserted them with the proper WPML language attributes:
// (...)
// Create the page
$customPage['id'] = wp_insert_post( $pageParams );
// Check if WPML parameters are needed
if (has_action('wpml_set_element_language_details')) {
// Set WPML parameters
$set_language_args = array(
'element_id' => $customPage['id'],
'element_type' => apply_filters( 'wpml_element_type', 'page' ),
'trid' => FALSE, // new translation id
'language_code' => 'it',
'source_language_code' => NULL
);
do_action( 'wpml_set_element_language_details', $set_language_args );
}
This solved my issue.
Related Posts:
- How to set post slug when using wp_insert_post();?
- Is there a better way to programmatically insert content into a page?
- Checkboxes to automatically create pages when I activate a theme
- Get page id by template
- How can I keep the content of my pages version controlled?
- How to load JS and CSS only on specific Pages using is_page()?
- Listing pages which uses specific template [duplicate]
- How do I convert a page’s title to lower case?
- WordPress page edit does not save selected template
- How do I set and list page_template with wpcli?
- How to get post or page excerpt using post_excerpt
- Different fields in My Profile page depending on user role
- Object gets unwanted width and height
- Automatically set page order on create page
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- What’s the most minimal way in which a page can be hooked into WP?
- Page with page template not using template in Preview
- Subpages return 404 error [closed]
- wordpress with many custom styled static pages
- Add custom text at bottom of every page?
- Remove specific page/post from feed
- Want Page Title to show on menu, but not on page
- Personal page for every user (not just authors)
- Create ghost page
- List pages by custom field?
- Password Protected Page Title
- Send mail from page using wp_mail
- Edit page’s “Restore the backup” link does nothing
- Load specific page template based on URI
- Show preview posts and pages to clients
- How to save post with different languages and linked them with WPML?
- I can’t edit my homepage – the page editor is just blank [closed]
- Page redirects to archive
- Making audio playlist by getting page’s parent’s ID
- Pages Column Sorting WordPress Version 3.0.3
- Adding Page URL to the Pages Admin Table
- More Fields Required For Password protect page
- page-name.php doesn’t execute on custom template
- Add categories and posts to page hierarchy
- How to retrieve attachments from child pages of a specific Page?
- Admin taking a very long time to load
- Hide page templates without using ‘unset’
- Custom page with queries returns 404
- WordPress Site Page Exists but Error 404
- How to capture GET argument on static page
- Custom page in archive page for certain category
- I would like my page editor to be sorted by date created, or updated, instead of in Alpha order, is this possible?
- Is it possible to check for shortcodes on a page?
- WordPress 3.2 – removed ability to select a page template in the page attributes when adding a new page?
- Can I “protect” a page with a form asking for an email address?
- Show FormCraft form on page open [closed]
- Use same page-mypage.php template for several pages
- Why last blog post excerpt is shown instead of meta description? [closed]
- Prevent non-admin to add/create new pages
- Is it possible to restrict access to specific pages in the admin area based on the page slug?
- How to create cutom link for page
- Set a variable to using in redirected page
- creating single page with 2 columns while theme is 3 column
- Outputting content from page
- Use an archive as the parent of a page?
- Publish page by invoking submit via jQuery
- Modifying .page-content background image
- Displaying the blog entries in a Page (using get_posts to retrieve the posts)?
- products category page editing
- “Can’t update in WordPress”
- Different template parts when on different pages
- Updating page template pragmatically
- Why can’t pages be categorized / tagged?
- Adding in additional pages into a custom theme
- Pages in wp-admin is not found 404
- Shortcode runs when editing page
- wordpress page navigation numeric pagination showing same posts on each navigation
- WordPress dosn’t save page/post updates
- Sup pages can’t be found
- How to use wp_dropdown_pages or wp_list_pages to accomplish a menu like this?
- Get child pages in get_pages function
- WordPress Page All Content In Template Good Or Bad Convention?
- Send e-mail from admin area to adresses in custom field
- Displaying Content Only in Certain Page IDs Not Working
- WordPress white screen with “All Pages”
- How to exclude sidebar from pages?
- How to Change the path of a child page?
- Annoying notification when trying to create a new page
- Page stuttering on load
- How To List Sibling Pages And Include The Featured Image?
- WP Template Hierarchy – Need help choosing the correct templates
- the_content() Returns post content when I want page content
- disable trashability for certain pages
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- Can’t select a page using is_page()
- If searched in a category show different 404 page
- pages won’t show on front page using loop or pre_get_posts
- How can I cycle posts with a #next and #previous script?
- Does WordPress list all pages for crawlers?
- List of pages – AJAX load more
- one time visit to the page
- How to display child page from specific parent page in homepage?
- How to display text of a page in home or custom page?
- Fresh WordPress installation not able to simply show page content