Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

reply

  • Hi I’ve been trying all day to get this to work, but no dice. Here is my code, but it always displays the plaintext email in HTML.

    $email = get_field('pro_email');
    <a href="mailto:' .  antispambot(get_field('pro_email')) . '">'. get_field('pro_email') .'</a>

    Any help would be greatly appreciated!

  • Hi Elliot,

    Thank you for your fast reply and super awesome plugin. It does in fact work perfectly when added in the init action. I guess my issue now is that I am actually trying to use it in a filter to filter out buddypress members that are listed in the site, and apparently the bp_ajax_querystring filter is not running at a time when I can use the repeater fields 🙁

    If you have any suggestions of how to get around it they would be much appreciated, otherwise I will have to figure something else out.

    Thanks!

  • Hello,
    I have the following code

    <?php $post_objects = get_field('repeater_related_items');
    if( $post_objects ): ?>
        <ul>
        <?php foreach( $post_objects as $post): // variable must be called $post (IMPORTANT) ?>
            <?php setup_postdata($post); ?>
            <li>
                <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
                <span><?php the_field('repeater_related_items'); ?></span>
            </li>
        <?php endforeach;?>
        </ul>
    <?php wp_reset_postdata(); ?>  
    <?php endif;?>
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Main Sidebar') ) : endif; ?>

    The problem is that when I add this to sidebar other widget doesn’t work.

  • I currently am exploring multilingual support for a multi-site installation, and as ever, relying on ACF for a lot of the configuration.

    I will reply here with some outcomes but initial thoughts are:

    * WPML seems to be the most advanced translation plugin – so support/solutions are widely available.
    * Polylang – creates new posts for each language, so works really cleanly in that sense and with ACF – could be a quick option on that basis.

    I shall endeavour to post back.

  • eliot – Thanks. It pointed me in the right direction. The real issue was that I was using a “Date & Time” field and the query wasn’t getting that. By changing my field type to just “Date” everything appears to be working.

    If you know of a way to get it to work with Date & Time, that might be nice, but if not this should suffice. Thank you.

  • 1) When I go to the Custom Fields edit screen and change the location rule my group applies to CPT (gallery) it will save to that type. All subsequent form entries go to the CPT. But when I go back to the custom field edit screen, the drop-down displays as default post. Essentially every time I go back to the form I have to manually change the location back to CPT option.

    2) With acf_form_head(); above get_header() call in a child theme of http://320press.com/wpbs/ in a very vanilla page template I have the following:

    <?php 
    $args = array(
    'post_id' => 'new',
    'field_groups' => array( 252 )
    );
     	
    acf_form( $args ); 
    ?>

    3) Unfortunately it’s all in local dev atm. But followed very closely to the instructions from http://www.advancedcustomfields.com/resources/tutorials/using-acf_form-to-create-a-new-post/ for it. Dev environment is a vagrant VM and Capistrano/Composer stack based on Roots.io bedrock mostly.

    Thanks

  • Hi @flowbob

    Becuase your WP_Query uses a literal string 'tag=$tagstr', the variable will not be converted.

    If you wish to use the parameter in this manor, just cahnge to double quotes like so:
    "tag=$tagstr"

    You can also wrap variables like so:
    "tag={$tagstr}"

    Your best bet is to always use an array instead of a string. Also make sure you use the post_type param.

    Thanks
    E

  • Hi @sdawson26

    Thanks for the request. This feature has already been added to ACF v5 which will be available soon.

    Thanks
    E

  • Hi @kharlo

    I would highly encourage you to not duplicate your data by having both taxonomy and custom field saving the save data.

    This ‘saving all the posts’ issue is only one of many synchronized issues you will experience with this data structure.

    If you are adamant about this method, you can write a custom loop using WP_Query and for each post, use the update_field function to save the taxonomy term ID’s as an array.

    Thanks
    E

  • Hi @likipe,

    This might be a bug. If you wouldn’t mind, I’d like to get some more information from you:

    What version of ACF and WP are you using?

    Is there any other fields attached to the post (within, or outside the repeater field in question), and do they appear when editing?

    Cheers

  • Hi @mswas,

    Try changing:

    $value = get_field($cbr6_review_number);

    to

    $value = get_field("cbr6_review_number");

    Cheers

  • Hi @Idealien

    Thanks for the questions.

    1. Can you clarify what you mean by this? Is the location rule not saving? If so, what is the location rule? You say my submissions go to the wrong location, please note that it is up to your code to insert the new post to the correct post_type.

    2. This is most likely the first value saved. What code are you using for the acf_form options?

    3. This may be a JS bug when in the front end form. Perhaps you can provide a link for me to take a look and test?

    Thanks
    E

  • thanks @elliot ! i guess i’ve the wrong search queries – including resolution lead into nowhere. :/

    about your link, unfortunately the suggested functions.php filter isn’t viable in my use case – one global minimum image dimension won’t do the trick. I hoped it would be possible to set image dimensions for each image field separately. I have implemented a responsive image solution including retina images as well and i wanted to take care that the user who is uploading the images isn’t uploading a too small version for a specific image field by accident, which might lead to image drop outs or other oddities.

    would it be possible to make a feature request for the acf and the repeater plugin? i think it would be a neat and useful feature – or what do you think about? best regards Ralf

  • Hi @robpinney

    This is a great question, and one which i’m sure is possible, but one that I have no idea how.

    My first though is one which has 2 parts:

    1. Filter query
    If you searched for ‘Elliot Condon’, find the post with this title (the bio post). Now you have an id of 123. Use this ID to modify the search parameter so that your search is for 123 (maybe you can target this as a meta_query only?).

    This should hopefully find books that have an author of 123.

    2. Filter the results
    If the above query works, then you can swap out ‘123’ for ‘Elliot Condon’ and your results should read correctly.

    This will be pretty complex and will require a lot of debugging and searching through source code, but it’s worth a shot.

    Also, I would ask the guys over at Relevanssi what their thoughts are.

    Cheers
    E

  • Hi @alpinepvp

    The repeater field is a great add-on to create repeatable data.
    A normal custom field can only contain 1 value, this is great for ‘Hero Image’ or ‘Welcome Text’.

    If you require the ability to create multiple values for the 1 field, this is when you need repeatable data and the repeater field.

    The repeater field will create a table like interface where you can specify the columns (like in excel) and then enter as many rows of data as you wish.

    This will be great to add each dish as a new row on the repeater field. Please checkout the docs to learn how to simply loop over the rows of data and output each dish!

    Thanks
    E

  • Hi @rpk

    Currently, this functionality is not possible in ACF, but it may be possible in WP to require a minimum size.

    Google revealed some threads which look interesting:
    http://wordpress.stackexchange.com/questions/28359/how-to-require-a-minimum-image-dimension-for-uploading

    Thanks
    E

  • If echo $tagstr; shows a value, then it sounds like tag=$tagstr is just returning zero results.

    “Tag=” can only look for tag slugs. Are you sure that the value of $tagstr is equal to the tag slug?

    http://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters

  • This helped! Now I am trying the acf/update_value.

    This is the code I have in my functions file:

    ///field update
    $field_name = "cbr6_review_total";
    $value = get_field($cbr6_review_number);
    update_field( $field_name, $value );
    
    

    But it doesn’t update the review total field (the user field) with the number from the review number field (on the post)

  • I tried

    $original_query = $wp_query;
    $tagstr = get_field('usertag');
    echo $tagstr;
    $wp_query = null;
    $wp_query = new WP_Query( 'tag=$tagstr')

    but it does nothing. (i echo’d $tagstr to check whether it’s the right value and it seems to be correct).

  • Hi @qstudio, I have added your request to our bug report for Elliot’s attention. 🙂

  • Hi @shankie,

    Looks like the taxonomy select field does not echo an ID, I have raised an issue with Elliot.

    In the mean time, can you update your jQuery selector to target the name? Eg:

    $('select[name~="field_52e7f08dec08a"]);

    I am using the contains word selector here => http://api.jquery.com/attribute-contains-word-selector/

  • In my functions.php, I am just running

    $hidden_users = get_field('hide-users', 'options'); 
    
    var_dump($hidden_users);

    which produces

    string(1) "2"

    I tried adding/removing items from the list to verify that the number that it is outputting is the count.

  • Hi @warpx,

    I reckon you will need to use our post object. 🙂

    It will return a WP post object that you can access using the standard WP functions. Eg:

    <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>

    Checkout out our example here => http://www.advancedcustomfields.com/resources/field-types/post-object/

  • Hi @likipe,

    I am not quite sure I follow you.

    So you have a File field that is repeated using the Repeater. When you populate the data in the post, it does not show when you edit it again?

Viewing 25 results - 18,976 through 19,000 (of 21,345 total)