Support

Account

Forum Replies Created

  • Yes well, not everyone is a developer. You don’t have to be one to use ACF, at least that’s how I would see the future of such a plugin anyway. Otherwise, it should state….
    ‘Caution, don’t touch this unless you’re a seasoned developer;-)

    Sorry to bother you..

  • Hi John,

    Thank you very much for kindly getting back to me!
    I just figured it out by a piece of code that works:

    add_filter('acf/format_value/name=listing_price', 'fix_number', 10, 3);
    function fix_number($value, $post_id, $field) {
    $value = number_format($value);
    return $value;
    }
    

    I wanted to format the front-end display!

    Now I just have to input the prices again of over 100 listings:-) But at least they display correctly!
    I wonder why this isn’t a default setting of ACF and a piece of code is needed to be displayed properly?

    Thank you very much for your time!

  • Update:
    Above code worked like so:

    add_filter('acf/format_value/name=listing_price', 'fix_number', 10, 3);
    function fix_number($value, $post_id, $field) {
    $value = number_format($value);
    return $value;
    }

    I can now see the correct comma separators for new entries that I place in the number field.
    Any suggestion as to how I can ‘correct’ previous entries as well?
    Otherwise, I have to manually adjust more than 100 different entries/listings!!

    THanks for any suggestions.

  • @hube2

    Hi there John,
    Could you help me? I’m trying to display commas in number type field, like so:
    120,000
    I tried some combinations of code I found in different threads, but nothing worked really!

    I have a particular field I want to format the numbers for, (listing_price).
    I also tried:

    add_filter('acf/format_value/number=listing_price', 'fix_number', 20, 3);
    function fix_number($value, $post_id, $field) {
      $value = number_format($value);
      return $value;
    	}

    but nothing happened.
    What do the numbers 20 and 3 mean above?
    I thought I’d need to replace them with my case for example 20000 (as currently displayed), to 20,000 as I want them displayed.
    In any case, code doesn’t work.

    Can you suggest something?

    Thank you for any help!

  • Hi guys,
    5 years later….:-)
    Does this code still work? I’ve placed it in my functions.php, but I still can’t get the acf to translate to my 2nd language..!

    Any further help will be hugely appreciated!!!

  • Thanks for sharing

    What do you mean? It hasn’t solved the problem!
    Do you have a suggestion pls?

  • I know I’m a bit too late in this! But please I need your help..!
    I’m trying to display ACF in front-end using:
    1.Elementor PRO
    2.ACF (free verstion)
    3. CPT Plugin
    4. Polylang Free (2 Languages)

    I applied this bit of code found in previous thread:

    function polylang_translate()
    {
        pll_register_string('back', 'back','General');
        pll_register_string('main_bedroom', 'Main Bedroom','General');
        pll_register_string('villa_size', 'Villa Size','General');
        pll_register_string('no_of_people', 'No of People','General');
        pll_register_string('bedrooms', 'Bedrooms','General');
        pll_register_string('bathrooms', 'Bathoom','General');
        pll_register_string('wc', 'W.C','General');
    }
    add_action( 'init', 'polylang_translate' );

    ..which displays the fields to be translated in Polylang’s back-end no problem. However, I don’t see the translated fields in front-end, neither within ELementor’s Dynamic field tags, (which is what I’m using to display the custom fields), or anywhere.
    I also added code displayed in this thread by Mark Howells-Mead in my functions.php, but I don’t see anything different happening.

    Can I make this work and have the fields translated and displayed somehow in the front-end?
    I don’t have much knowledge in coming up with my own code, nor have I used current set up with above plugin combo to achieve this.
    Any advice / help will be much appreciated 🙂

    Thank you

  • Hi Jared,
    Thank you very much for taking the time to help me out!
    I appreciate your code too!
    In fact, I have created a taxonomy for ‘Listing-Location’ for my Custom post type, (created with CPT plugin).

    I know enough to change the slugs of your code but if you could kindly clarify, where would I place this PHP code so it displays in my section?
    On the taxonomy code, (provided within the CPT plugin interface)?
    That’s my trouble…not sure where to implement it!

    Thank you again and if it helps, I’m trying to achieve something very similar to the example

    at the section titled: ‘Explore Cities’ towards the end – they show for example Chicago: 13 properties.
    Well, I’m trying to get this dynamically to show for my locations!

    Thank you!!!

  • I see…!
    Thank you for your patience!!
    It’s very unfortunate though that ACF has not evolved to broaden its usage for front-end displaying too!
    On the other hand, thank God we have tools such as elementor and dynamic fields to help us most of the way with this.

    I will try and implement your code in my functions.php and see if I can make it work that way. I will back-up, then back-up and back-up my installation before I proceed and see if I can work it out 🙂

    I can understand some pieces of your code, but I couldn’t come up with it myself…!

    Thank you again!!!

  • Hi John Huebner,

    Thank you for your time to reply and your willingness to help!
    I’m not certain I understand why I should direct my questions to Dynamic Fields!?
    I understand that I’m using Dynamic fields sure, but, I’m using them to display ACF. If you’re not coding them yourself to display them at the front-end, (which is by itself a complex undertaking), then, you’ve got to use some other means/tool to display them right?
    My issue is that there aren’t ‘display conditions’ within the field’s menu, (when you create that particular field), to manage when you show that field, or not. I use display conditions on a ‘field group’ level to display them at the admin screen only.

    I have 2 Field Groups. Both, for the same CPT.
    One is for ‘house listings’ the other for ‘land listings’.
    How can I make both group fields show for the particular listing on an archive page?
    This archive page displays both listing taxonomies. Users can filter out which type they want to see, but on page load, both are visible to the user.
    So far, I found that I can only display one or the other, no matter what taxonomy is displayed at front-end.
    I was partly able to show particular ‘section’ of taxonomy by using the ‘Dynamic Conditions’ plugin.
    But I’d love to figure out how to really solve this problem.

    Thanks again for your time!

  • Someone…please!
    There’s got to be a solution out there somewhere..?

Viewing 12 posts - 1 through 12 (of 12 total)