Support

Account

Home Forums Search Search Results for 'WPML'

Search Results for 'WPML'

reply

  • Hi @unsalkorkmaz

    The ‘layout’ is a hidden custom field, as in it has an ‘_’ before the meta_name.
    This is most likely hiding it from WP.

    Sorry, but I can’t be of much other help on this one.

    Thanks
    E

  • for example:
    http://i.imgur.com/ReFwtI3.png is panel for http://base.theme.firmasite.com/
    other example ss: http://i.imgur.com/pqa1TUg.png

    So i cant predict which flexible content field’s layout is used in what order and how many. It can be text block, image, map etc.. postmeta names are like content_blocks_0_collection_type as my example in above so how can i make them translatable?

    I should really send my theme to you for showing problem better tho. I am using flexible content field a bit different.

  • Hi @unsalkorkmaz

    When you say “wpml see”, I think you are refering to a special interface which WPML has for bulk translation. Is this correct?

    If so, then no, this interface cannot be customized.

    The data should look quite self explanatory. The meta_name shows the parent field name, the row number and the sub field name.

    I’m sure if you translated each cell of data, it would work fine.

    Is there any specific issue you are having. So far, your question has been very vague

    Thanks
    E

  • wpml see flexible field’s custom fields like these:

    
    content_blocks_0_collection_type
    content_blocks_0_contents_to_link
    content_blocks_0_header
    content_blocks_0_options
    content_blocks_0_row_percentage
    content_blocks_0_tab_location
    content_blocks_0_tab_style
    content_blocks_1_collection_type
    content_blocks_1_gallery_images
    content_blocks_1_header
    content_blocks_1_row_percentage
    content_blocks_1_tab_location
    content_blocks_1_tab_style
    content_blocks_1_text_block
    content_blocks_2_add_marker
    content_blocks_2_add_marker_0_header
    content_blocks_2_add_marker_0_location_desciption
    content_blocks_2_add_marker_0_location_map
    content_blocks_2_gallery_images
    content_blocks_2_header
    content_blocks_2_row_percentage
    content_blocks_2_text_block
    

    whats solution here?

  • Hi @unsalkorkmaz

    Sure, I don’t see why not.

    What are you having an issue with?

    Thanks
    E

  • Hi @Rodolphe

    Thanks for the code. Looks great!

    Cheers
    E

  • Hi Elliot,

    I’m facing the same problem here. If you do not transalte ACF fields some rules are not available for every languages.

    Say you create a group with a rule set to the category “CatA” that exist in english and is translated as “CatA @fr” in french, the group will only appear on english posts set with the english category, not on french posts set with the translated category “CatA @fr”.

    I’ve fixed this for now by adding :

    if( defined('ICL_LANGUAGE_CODE') )
    {
    	$rule['value'] = icl_object_id($rule['value'], 'category');
    }

    in the function ‘rule_match_post_category’ on line 550 of the location.php file.

    I think it would be great for a rule set as “Category” to be applied on posts with translated category. It could also be done for rule set to a specific post or page.

    Thanks,
    Rodolphe

  • Hi @pionect

    Thanks for the info. I’m hoping to spend some time looking at the compatibility between ACF and WPML soon

    Thanks for the links.

    Cheers
    E

  • I’ve worked with ACF and WPML quite a bit myself and we’ve developed the habit that if you want to create a translation with the content copied you’d have to go into the post/page and then duplicate it, head over to the new post/page and hit the translate separately button.

    I’m not surprised why WPML blame ACF. Honestly my experience with their support is pretty lousy (and I’m not the average joe who run a hobby-site). I’m not saying the issue isn’t with ACF but to my knowledge ACF uses standard post_meta values which WPML should be able to copy when making a new translation.. I’ve made a copy-function of my own involving ACF meta fields without issues (not related to WPML) so…

  • I’m having the same issues. I’m using WooCommerce, WPML and ACF. WooCommerce creates a custom taxonomy called ‘product_cat’. The name of the field I’m trying to get is ‘Subscribe Field Name’.

    I’m using the following, but it’s not returning anything:
    <?php echo get_field('subscribe_field_name', 'product_cat_16');?>

    It’s driving me crazy.

  • Thanks Elliot, i’ll update you on this thread if i get news from WPML side.

  • Hi @Rics

    Thanks very much for your help with this issue.
    I have quite a lot on my plate at the moment, but sometime int he future I am looking forward to sitting down and making sure ACF is completely compatible with WPML.

    Thanks
    E

  • This reply has been marked as private.
  • This reply has been marked as private.
  • Thanks sirjonathan, i’ve found the problem caused by WPML functions. Thanks!

  • @flashpunk: here is how i did it:

    1) Created a custom post type, named my_settings. Obviously, is translatable by WPML
    2) Created a page template for each settings page. Fortunate, i had only two pages. So, now we have tpl-home_carousel.php and tpl-other_options.php
    3) Created a page for each template. For now it’s enough to have them in base language (english)
    4) Created an option page that sets the id’s for these pages. (there is a post object or something like this; you need the ID) (for the sake of simplicity, i named all options here as wpml_*). We need this only for base language.
    5) The old option pages (those with real … options) are now set as to be displayed on certain templates (those that we set earlier)

    Done with admin!

    Right now, we need a way to get the id for get_field('our_awesome_setting', ID) function.

    We first get the ID for base language page:
    $home_carousel = get_field( 'wpml_options_home_carousel_page', 'option' );

    We then get the translated page (or base page if there is no translation):
    $home_carousel_id = icl_object_id( $home_carousel->ID, 'my_settings', true, ICL_LANGUAGE_CODE );

    Then we set a constant with this translated ID:
    define( 'MY_OPTIONS_HOME_CAROUSEL', $home_carousel_id );

    After this, everything is just fine. We can get fields as usual, but instead of using option param, you use this constant we defined earlier:

    $gallery_rows = get_field( 'home_gallery_rows', MY_OPTIONS_HOME_CAROUSEL );

    Done!

    (let me know if i explained well)

    Very, very late edit: you can set templates to custom post types by using this plugin: http://wordpress.org/plugins/custom-post-type-page-template/

  • I have this issue – i’m using the Options add on to collect about 30-40 different ads for a WPML Networked blog site (theres 6 sites, but only 2 of them have 2 languages). Our client recently informed us that the french / english sites need to have different ads. I’d rather not have to re program the entire thing, and have to re load all the ad codes for each site, i’m wondering if there is a way to make a separate options page for each available language?

    Is this possible? if so, some guidance would be appreciated!

  • Hi @zjk

    What is the location rule?

    perhaps the data is duplicating correctly, but then the rule doesn’t match on the translated version because the post_id or categroy ID is different.

  • Hmm! It appears that the plugin is checking for the icl_object_id function, which requires that WPML (a translation plugin) be installed.

    Now, a quick check at the source code, though, shows that it’s checking for ICL_LANGUAGE_CODE to be defined. Is that constant, perhaps, being used elsewhere in your installation? Did you have WPML installed at one point?

  • Hi,
    i have to say that the problem is only on the default language. I use WPML and if I change to another language the data appeares. Any ideea?

  • Hi,
    Thanks for your answer. I must admit, this is way above my skill levels. I found the date_i18 in wp-includes/function.php but can’t figure out where to add the snippet or what to modify. Can you please look at my function and tell me what to do?

    
    function date_i18n( $dateformatstring, $unixtimestamp = false, $gmt = false ) {
    	global $wp_locale;
    	$i = $unixtimestamp;
    
    	if ( false === $i ) {
    		if ( ! $gmt )
    			$i = current_time( 'timestamp' );
    		else
    			$i = time();
    		// we should not let date() interfere with our
    		// specially computed timestamp
    		$gmt = true;
    	}
    
    	// store original value for language with untypical grammars
    	// see http://core.trac.wordpress.org/ticket/9396
    	$req_format = $dateformatstring;
    
    	$datefunc = $gmt? 'gmdate' : 'date';
    
    	if ( ( !empty( $wp_locale->month ) ) && ( !empty( $wp_locale->weekday ) ) ) {
    		$datemonth = $wp_locale->get_month( $datefunc( 'm', $i ) );
    		$datemonth_abbrev = $wp_locale->get_month_abbrev( $datemonth );
    		$dateweekday = $wp_locale->get_weekday( $datefunc( 'w', $i ) );
    		$dateweekday_abbrev = $wp_locale->get_weekday_abbrev( $dateweekday );
    		$datemeridiem = $wp_locale->get_meridiem( $datefunc( 'a', $i ) );
    		$datemeridiem_capital = $wp_locale->get_meridiem( $datefunc( 'A', $i ) );
    		$dateformatstring = ' '.$dateformatstring;
    		$dateformatstring = preg_replace( "/([^\\\])D/", "\\1" . backslashit( $dateweekday_abbrev ), $dateformatstring );
    		$dateformatstring = preg_replace( "/([^\\\])F/", "\\1" . backslashit( $datemonth ), $dateformatstring );
    		$dateformatstring = preg_replace( "/([^\\\])l/", "\\1" . backslashit( $dateweekday ), $dateformatstring );
    		$dateformatstring = preg_replace( "/([^\\\])M/", "\\1" . backslashit( $datemonth_abbrev ), $dateformatstring );
    		$dateformatstring = preg_replace( "/([^\\\])a/", "\\1" . backslashit( $datemeridiem ), $dateformatstring );
    		$dateformatstring = preg_replace( "/([^\\\])A/", "\\1" . backslashit( $datemeridiem_capital ), $dateformatstring );
    
    		$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
    	}
    	$timezone_formats = array( 'P', 'I', 'O', 'T', 'Z', 'e' );
    	$timezone_formats_re = implode( '|', $timezone_formats );
    	if ( preg_match( "/$timezone_formats_re/", $dateformatstring ) ) {
    		$timezone_string = get_option( 'timezone_string' );
    		if ( $timezone_string ) {
    			$timezone_object = timezone_open( $timezone_string );
    			$date_object = date_create( null, $timezone_object );
    			foreach( $timezone_formats as $timezone_format ) {
    				if ( false !== strpos( $dateformatstring, $timezone_format ) ) {
    					$formatted = date_format( $date_object, $timezone_format );
    					$dateformatstring = ' '.$dateformatstring;
    					$dateformatstring = preg_replace( "/([^\\\])$timezone_format/", "\\1" . backslashit( $formatted ), $dateformatstring );
    					$dateformatstring = substr( $dateformatstring, 1, strlen( $dateformatstring ) -1 );
    				}
    			}
    		}
    	}
    	$j = @$datefunc( $dateformatstring, $i );
    	// allow plugins to redo this entirely for languages with untypical grammars
    	$j = apply_filters('date_i18n', $j, $req_format, $i, $gmt);
    	return $j;
    }

    Thanks for your help!

  • Hi!

    You’ll need to first change it to unix timestamp and then use
    date_i18n function.. here’s a snippet:

    
    <?php $timestamp = strtotime(get_field('yourdatefield')); ?>
    <time datetime="<?php echo date(DATE_W3C); ?>" pubdate class="updated"><?php echo date_i18n( 'j M', $timestamp); ?></time>
    
    

    The key parts here is the first row and then the date_i18n function.. Change the first parameter of date_i18n (j M) to whatever timeformat you require 🙂

  • Hi @fishfang

    A quick search in the above form gave this thread which I believe will help you:
    http://support.advancedcustomfields.com/forums/topic/wpml-and-acf-options/

    Cheers
    E

  • Hi @nytrm

    Perhaps there is a bug with the Translation Management plugin…

    I’ll do some testing in the future, but unfortunately for now WPML cannot take priority of my work.

    Thanks
    E

  • Hello i solve my question with this code:

    <?php if ( get_post_meta( get_the_ID(), 'indirizzo', true ) ) : ?><p><span class="list">
    			     <?php _e( 'Indirizzo: '); ?>
                </span>
                <?php the_field('indirizzo'); ?> </p><?php endif; ?>
Viewing 25 results - 426 through 450 (of 495 total)