Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

reply

  • Hi @rddesigns

    Sorry, I don’t understand what you mean by ‘access pin’. Would you mind elaborating more on this and why it would be useful?

  • Hi @Steve Holland

    Thanks for the request. This isn’t as easy as you may think to add in.

    Would the ‘x’ number of rows contain different default values in the sub fields?

  • Hi @edir

    Thanks for the feedback.

    Currently this is not possible unless you were to edit the core files of the options page add-on.

    I will add this request to the to-do and hopefully see it released in an update soon

    Cheers
    Elliot

  • ok Elliot, thanks but…
    it gets this :

    array(2) {
      [0]=>
      string(2) "en"
      [1]=>
      string(2) "fr"
    }

    How tests “en” checkbox is checked and test “fr” is checked ?

  • This sounds like more of an HTML issue than something to do with ACF.
    If links are opening in a new window, you probably have target=”_blank” on the anchor element, right? To get an overlay would depend on your HTML/CSS/JS setup. For example, if you’re using Twitter Bootstrap, this would be done by setting data-toggle=”modal” and data-target equal to the modal div selector (which would have the video as its content).

  • @mikosworld,

    Try this:

    $lang = get_field('language');
    	
    if ( 'en' === $lang ) { 
    	echo "ENGLISH Flag icon"; 
    }
    elseif ( 'fr' === $lang ) { 
    	echo "FRENCH Flag icon"; 
    }
    
  • @elliot,

    I’m liking the typeahead on users and tags.

    Another possible feature – the ability to view only unread/unsolved (question) topics?

  • Hi @moud

    Did @wells5609 reply solve your question?

  • Hi @Ailsa_C

    This is not an issue regarding ACF or an inability to load data, but a question on how to use HTML and CSS to create a design.

    This question would be best asked on another forum such as stackexchange as this forum is for issues regarding ACF.

    I agree that you are using ACF to create the HTML, but I don’t offer free support foru basic CSS / HTML help.

    Thanks for understanding

    Cheers
    Elliot

  • Thanks rmdev, it would be great if you could share that bit of JS. I am sure there are also other developers who will find it useful.

  • Thanks for your response, actually this does not solve the issue. Let me explain better.

    This is a part of my php file for the field:

    <?php
    
    class acf_field_number_range extends acf_field
    {
    
    (..)
    
    <script type="text/javascript">
    
    $("#slider").bind("valuesChanged", function (e, data) {
       $.ajax({
       type: "POST",
       dataType: "text",
       url: "../wp-content/themes/twentytwelve/fields/test.php",
       data: { minValue: data.values.min, maxValue: data.values.max },
       async: false,
       success: function(data){
          alert(data);
          
        },
         error: function(xhr) {
                 alert('fail')
                }
     });
    });
    
    </script>

    But the alert popup gives this error:

    Fatal error: Class ‘acf_field’ not found in /home/…/…etc/../..etc/ test.php</b> on line 3

    How can I get these values of the range slider? Thanks

  • Another quick somewhat related question. I try uploading files as a logged out user and get an uploading error:
    An error occurred in the upload. Please try again later.

    I’m looking in my PHP console and don’t see any issues and none in my JS console either. Do either of you happen to know what this is about?

    Thanks!

  • You mentioned when you loaded the .php file directly, does this mean this isn’t a part of a WordPress page? A stand-alone PHP page? I’m not sure whether ACF fields would be accessible through this or not, i’d guess not.

    You’d be better off adding a php callback function for your ajax in your functions.php file.

    Here’s a simple example of getting a field with AJAX:

    In your functions.php:

    
    add_action('wp_ajax_getdatefunction', 'getdate'); 
    add_action('wp_ajax_nopriv_getdatefunction', 'getdate'); 
    function getdate(){
    
       the_field('your_date_field');
    
       die();
    }
    

    In your JS file:

    
    $('button').click(function(){
    	$.ajax({
    		type: "POST", 
    		url:'/wp-admin/admin-ajax.php',
    		data: 'action=getdatefunction',
    		cache: true, 
    		success: function(results){
    			$('.your-date-container').html(results);
                            alert('The date is: '+results);
    		}
    	});
    });
    
  • The default setup doesn’t allow required sub-fields in Repeater fields I don’t think. This doesn’t mean to say you can’t come up with your own solution though.

    I’d approach this in either 2 routes:

    1) Create bit of jQuery that sits on the edit pages of WP and doesn’t allow the post to be Published until the required sub-fields are validated.

    2) Simply add conditional code to wherever you are using the sub-fields data to not output the element if the sub-field isn’t populated (I do this often for things like captions or titles in repeater fields)

    If you need help with the first bit of JS let me know as i’ve written something similar for a major project that required custom validation of ACF fields.

  • You’d be looking at a simple bit of jQuery like this (obviously you will have to change the selectors)

    
    currentSlide = $('.slider .active');
    nextSlide = currentSlide.next();
    prevSlide = currentSlide.prev();
    
    /** then to get for instance, a caption from inside the slides : *//
    nextSlideData = nextSlide.find('p.caption').html();
    prevSlideData = prevSlide.find('p.caption').html();
    
    alert('Next caption: '+nextSlideData+' & Previous caption: '+prevSlideData);
    
  • I’m looking into any differences with included scripts on the page but when I use typeof acf I get back "object" so it seems to be getting included properly.

    I’ll update with the scripts that are being included on the page.

    UPDATE: However, when I include jQuery myself (it looks automatically included from acf_form_head(); ) via a normal scrip tag, I get the Uncaught ReferenceError: acf is not defined.

    Very very strange

  • Hi @rafael401

    The relationship field will only be able to save data about a post_id, so unfortunately what you want to do is not possible with this field.

    Essentially, what you are describing is a relationship from a render to a building with metadata on the connection. The metadata states the room in the building.

    I think a solid solution will be to use the posts 2 posts plugin instead of the relationship field.

    It is a very flexible plugin which requires good PHP knowledge, but has good documentation so it’s not too hard to get started with it.

    That plugin will allow you to create these connections with the extra ‘meta’ data on each connection.

    Hope that helps.

  • Hi @harini

    Thanks for the detailed description of the issue.

    I believe the the solution is quite simple, and is the fact that you care using the wrong $post_id parameter to load data from a taxonomy term.

    Please read over this article and pay special attention to the post_id param:

    http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-taxonomy-term/

    Your post_id param should be

    'category_' . $category_id

  • Anyone that stumbles across this post in need of help with importing a CSV of posts into WP, try out this plugin. It allows you to add columns for all of the default WP fields like the_title, the_content and so on. It also allows any custom fields to be added as columns, so ACF is completely compatible.

    In fact, you can even stick a repeater field into the CSV. I done this for a recent site.

    You’d have the columns like:
    repeater_0_text, repeater_1_text, repeater_2_text, repeater_3_text

    And then another just called ‘repeater’, with the amount of sub-fields (in this example, the value would be 4).

    Give it a try! Hope this helps someone one day.

    http://wordpress.org/plugins/csv-importer/screenshots/ (I know it’s old, but it works)

  • O.K thanks for the update, will keep an eye out for that feature release.

    Not sure why it was posted as a ‘Post’ as I thought I ticked the question option as your right it’s definitely a questions.

    Cheers
    Heath

  • Hi @evzin

    1. Yes, the multi-site license allows you to use the add-ons in all web projects you work on. You can also incude the add-ons within premium themes, however, this may change in the future with an introduction of a developer license.

    2. Yes, all add-ons will recieve updates

    3. ACF is required for the add-ons to function. Think of it as a limb needs a body to work.

    4. Yes and No. The flexible content field can replicate all of the repeater field functionality except it’s user experience. A client will be much happier using the repeater field to upload images / files at it supports multiple file uploads / quicker to add rows. Also, the code is simpler in the templating.

    5. You may us the message field to add HTML to the options page!

  • Thanks mate,

    I like both the ideas. I’ll have a look at adding these in.

  • Hi @zquintana

    Great work on the code. Would you mind editing that reply and marking it as the topic solution?

    Thanks mate

  • Check the ‘postmeta’ MySQL table (in phpmyadmin, you can search for it by the post_id).

    One thing I would make sure is that your field has a field reference – this will be another postmeta entry with the same meta_key as your field prefixed with an underscore (e.g. if your field name is “my_field” the reference field meta_key would be “_my_field”). The meta_value of the reference field should be something like “field_2342451923sf” – however, if it is like “temp_key_for_my_field”, your field was not saved/created correctly. If you can verify this is not the case, that would be a good first step.

  • @zquintana,
    Nice workaround and thanks for the info on brackets (seems like PHP is borrowing a thing or two from javascript)

Viewing 25 results - 21,301 through 21,325 (of 21,345 total)