queue  1066
support custom
Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Social Media for a bilingual Website [SOLVED]

  1. #11
    Junior Member
    Join Date
    Dec 2012
    Posts
    17
    Where should this code go?
    What i am referring to is under 17.3 Translation Exceptions>Widgets in the Brandspace Documentation.

  2. #12
    Lead Support Ante's Avatar
    Join Date
    Oct 2012
    Posts
    13,404
    Oh, so what is unclear to you?

  3. #13
    Junior Member
    Join Date
    Dec 2012
    Posts
    17
    It says "We have made a custom widget called "WPML conditional."" Its continues,
    1. Go to the widgets page.
    2. Drag the "WPML conditional" widget into the sidebar/widget area.

    The problem is: The "WPML Conditional" widget does not exist in the widgets page.

  4. #14
    Lead Coder Fabio's Avatar
    Join Date
    Aug 2011
    Posts
    1,880
    Hello

    you disabled that widget by commenting the line

    PHP Code:
    //PeGlobal::$config["widgets"][] = "Wpml"; 
    i didn't had the time yet to check latest Brandspace update with wp 3.5 / wpml 2.6.2 yet, for sure there are issues between wpml 2.6.1 and latest wordpress release.

    Will do some testing tomorrow morning and update the thread as soon as possible.
    My cave is full of servers

  5. #15
    Junior Member
    Join Date
    Dec 2012
    Posts
    17
    I had a problem after the update of both WPML and WP. When i activated the WPML plugin after the update all my post, media and pages admin pages did not list anything. I consulted with WPML support and this is what they said. I have also sent this information to the BrandSpace support as feedback. I hope this helps you in resolving these issues. Thanks for your support.

    This was their feedback on rectifying the problems between the theme and WPML:

    It seems to be theme problem, Please contact your theme author to check following function in /themes/brandspace/framework/php/PeTheme/PeThemeWPML.php

    public function instantiate() {
    if (function_exists("icl_get_languages")) {
    //PeGlobal::$config["widgets"][] = "Wpml";
    }
    //PeGlobal::$config["shortcodes"][] = "Wpml";

    add_filter('widget_display_callback', array(&$this,'dynamic_sidebar_params_filter'),10,3 );
    }

    I have commented //PeGlobal::$config["widgets"][] = "Wpml"; and }
    //PeGlobal::$config["shortcodes"][] = "Wpml";

  6. #16
    Lead Coder Fabio's Avatar
    Join Date
    Aug 2011
    Posts
    1,880
    yeah, i was referring to that mail you sent to us. Will have a go with 3.5 and latest wpml plugin tomorrow morning.
    My cave is full of servers

  7. #17
    Lead Coder Fabio's Avatar
    Join Date
    Aug 2011
    Posts
    1,880
    I took a look at the code and, despite what wpml support told you, issue is not related to our theme but to their plugin:

    http://wpml.org/forums/topic/calling...wordpress-3-5/
    http://wpml.org/forums/topic/calling...setting-query/

    as soon as one calls icl_get_languages (which is documented here), wordpress 3.5 crashes with an error in query.php.
    We need icl_get_languages for our conditional widget and lang shortcode to work, by commenting those lines it doesn't get called so the wpml error doesn't trigger anymore.
    My cave is full of servers

  8. #18
    Lead Coder Fabio's Avatar
    Join Date
    Aug 2011
    Posts
    1,880
    The issue seems related to icl_get_languages not being able to propely reset the query, the workaround found in one of those posts appears to work

    PHP Code:
    // edit /themes/brandspace/framework/php/PeTheme/PeThemeWPML.php
    // undo the change wpml support made you do

    public function options() {
            
    $options[__pe("Any")] = "" ;
            
    $langs icl_get_languages('skip_missing=0');



            
    // add this line here
            
    wp_reset_query();



            if (
    is_array($langs)) {
                foreach(
    $langs as $value) {
                    
    $options[strtoupper($value["language_code"])] = $value["language_code"];
                }
            }
            return 
    $options;
            
        } 
    My cave is full of servers

  9. #19
    Junior Member
    Join Date
    Dec 2012
    Posts
    17
    It looks like it worked. thank you.