Support

Account

Forum Replies Created

  • if only it were that simple…

    “=” returns nothing
    “INCLUDE” returns nothing
    value => array(‘Melbourne’) with compare => “=” (or INCLUDE) returns nothing

  • Apparently this should work but doesn’t

    $args = array(
                'post_type'=> 'event',
                'posts_per_page' => -1,
                'meta_query' => array(
                    'date' => array(
                        'meta_key' => 'type_0_date',
                        'compare' => 'EXISTS',
                    ),
                    'tbc' => array(
                        'meta_key' =>'type_0_coming_soon',
                        'compare' => 'EXISTS',
                    )
                ),
                'orderby' => array(
                    'tbc' => 'DESC',
                    'date'=>'ASC'
                ),
    
            );
  • At the moment it seems my best way is to use a CSS aggregating plugin. I am using Autoptimize and it works very well, picks up my 40 CSS files and bundles into one. It remains to be seen whether I get penalised for render blocking.

    It would be nice to have a more targetted solution; gather all the CSS for only the blocks used on the page and parcel that up into one file. The other page CSS can take care of itself. It might even be that the first two blocks (above the fold) could be put into a separate file.

  • It has indeed, without any working solution I can find, and I’ve waded through all the research many times.

    What’s the difference between ‘Feature Requests’ and ‘Feedback’ ?

    I think you were right, when you said there was a solution that was abandoned, that building on that work may be the way forward. It’s not that easy to find the source any more, it’s been removed from github.

  • For anyone who passes this way;

    add_filter ('acf/blocks/no_fields_assigned_message', 'no_fields_message', 10, 2);
    
    function no_fields_message($message, $block_name) {
    
           if ($block_name === "acf/my-block") {
               $message = "Nothing to see here, please move along";
           }
    
        return $message;
    
    }
  • Thanks @hube2.

    Our server admin are reluctant to go over 5,000. I don’t quite understand the link with DDOS but I hear it.

    I’ll try the plugin, at least it will give some confirmation of the issue.

    I’ve been using ACF for years, it’s quite a disappointment to find its limitations.

  • Or, I guess, a clue to how I could target these things in jQuery ‘change’ events

  • @alryalls did you ever arrive at a solution to this?

    And to Thomas, the ACF is controlling, I assume, the Event Date and the answer to your question is it will need to be toggled.

  • I’m interested why you don’t think 300 rows is a good idea – surely a CPT has more database overhead?

    Anyway, this post helps;

    https://felicoz.com/en/2017/05/acf-import-repeater-field-values-csv-programmatically/

    if you add the line
    add_row('repeater_name', array("","")); in the while loop, (obviously as many empty values as sub fields), then it will add the rows too.

  • There is a bug in the operation of this. If you have set up the field without the ‘Allow null’ option and chosen a page there is no way to delete that page link.

    IE if you change the field to ‘allow null’ you can choose a different page and delete it but the original choice is then the field value/

  • @hereswhatidid Nice work. For anyone who uses this code, make sure line 20

    if ( classArr[i].indexOf( 'rmg-' ) === 0 ) { is changed to

    if ( classArr[i].indexOf( 'hwid-' ) === 0 ) {

  • The repeater rows are a table with each iteration being a row <tr>. Essentially it’s to put in some custom CSS that treats a tr as inline-block – which is horrible but works in some browsers.
    Probably best to include the field class (the field ID) so you don’t get unintended consequences.

    As my original post suggests I would like more control over repeater fields layout in admin but rewriting the core code for divs rather than tables seems like it may be quite a lot of work.

  • Sorry to revive an old thread but I pulled your code from the example above;

    <? if (get_field('date-start')) : ?>
      The next opportunities to undertake this workshop are: <br/>
      <?
      $format_in = 'yymmdd'; // the format your value is saved in (set in the field options)
      $format_out = 'D d MM'; // the format you want to end up with
    
      $date = DateTime::createFromFormat($format_in, get_field('date-start'));
      echo get_field('date-start');
      //echo $date->format( $format_out );
      echo '$date: <pre>';
    	print_r($date);
      echo '</pre>';
    
      endif;
    ?>
    

    Outputs;

    The next opportunities to undertake this workshop are:
    20150725$daten: 

    ie the date-start field is valid.
    if I uncomment this line //echo $date->format( $format_out );

    I get a fatal error.

    PHP 5.5

  • To work with Colorbox, this

    <?php 
     
    $image_ids = get_field('gallery', false, false);
     
    $shortcode = '
     
     
    [gallery ids="' . implode(',', $image_ids) . '"]
    ';
     
    echo do_shortcode( $shortcode );
     
    ?>

    needs to be

    <?php 
     
    $image_ids = get_field('gallery', false, false);
     
    $shortcode = '
     
     
    [gallery ids="' . implode(',', $image_ids) . '", link="file"]
    ';
     
    echo do_shortcode( $shortcode );
     
    ?>
    
  • Of course, sorry I should have thought

    I don’t see how to attach a file so it’s here;

    http://www.chrispink.co.uk/ACF-slider.xml.zip

    I am also wondering…. I have WordPress 3.6.1 on the local server (and 3.8.0 on the remote). Would this be sufficient? though both ACF versions are 4.3.4

    problem is; testing is difficult as I had to manually fix yesterday and I’m reluctant to break it again.

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