Sticky Custom Post Types
sticky post not work with wpml plugin (3 posts)

  1. eliawk
    Posted 3 years ago #

    if i disable WPML i can check the sticky post options – when i enable your plugin all post became unchecked.

    the wpml team tell me to ask the developer of the plugin to go here



  2. Pancho Perez
    Posted 3 years ago #

    HI eliawk,

    Have you fix this? I have the same problem.

  3. m4olivei
    Posted 2 years ago #


    Found the same issue. The problem is that WPML filters the sticky_posts option (in wp_options table), which is where the sticky data lives in the database. WPML joins on their own icl_translations table to translate the sticky data, which is good, only it hardcodes a check that the post is of type post. Thus WPML won't allow custom posts types to be sticky. To fix this, you need to patch WPML. Open plugins/sitepress-multilingual-cms/sitepress.class.php

    I'm using version 2.8.1 and so the line I needed to alter was 6320. It's the option_sticky_posts function and we need to edit the query line to the following:

    $posts = $wpdb->get_col("SELECT element_id FROM {$wpdb->prefix}icl_translations WHERE element_id IN (".join(',',$posts).") AND element_type LIKE 'post_%' AND language_code = '{$this->this_lang}'");

    eliawk, where is the thread on the WPML forum about this that you allude to? I'd like to submit a patch to them.


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Sticky Custom Post Types
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.