Support

Account

Forum Replies Created

  • @mlangone
    I have a global style.css included in the functions.php

  • Hey, did you find a solution for this?

  • Hey, did you find a solution for this ?

  • Ok, got it. You do it via the JS Hooks 🙂

    acf.addAction('append_field/key=field_5c88dd5d00e5c', append_field);
    
    function append_field($el){
      $el.val(Math.random());
      $el.disable();
    }
  • Just look in the wordpress codex. I cant tell you, how the path has to be. I dont know your wordpress / theme setup 🙂

  • Maybe the path to landing_page.php is just wrong ?

    
    render_template
    (String) The path to a template file used to render the block HTML. This can either be a relative path to a file within the active theme or a full path to any file.
    
    // Specifying a relative path within the active theme
    'render_template' => 'template-parts/block/content-testimonial.php',
    
    // Specifying an absolute path
    'render_template' => plugin_dir_path( __FILE__ ) . 'template-parts/block/content-testimonial.php',
    
    
  • Can you see some html from landing_page.php in the page itself?

    Is the html rendering and “only” the Content is not showing up ?

  • Hey,

    maybe my english is not good enough 🙂

    I have a question to Question/Answer 2

    “2. Yes, our update system will allow betas to appear in the wp-admin plugins page ”

    Question was: can we Update from beta 3 to beta 4 to 5.8 live. In the answer i only see “update system will allow betas”.

    I understand it so that there is only beta to beta update via the wp-admin, not beta to live.

  • Hi,

    i used $field[‘value’][‘url’] = “https”; because in my quck test it seems right.

    And the other Problem, yeah, thats what i meant with

    “if there is already a “good” url saved.”

    You have to validate inside the function if $field[‘value’][‘url’] is already a valid url.

    Should be something like these

    if($field[‘value’][‘url’] != valid url){
    //no valid url, fill the field with https/http
    $field[‘value’][‘url’] = “https”;
    }else{
    //already a valid url here, nothing to do
    }

    return $field;

    Sry, im not a php developer, but if you google for “php validate url” you should find something, thats fit.

    I think this could work here: https://stackoverflow.com/questions/7003416/validating-a-url-in-php

  • Hi,

    maybe you try it with this

    https://www.advancedcustomfields.com/resources/acf-prepare_field/

    
    function my_acf_prepare_field( $field ) {
      $field['value']['url'] = "https";
      return $field;
    }
    
    add_filter('acf/prepare_field/key=field_5c6691766a1c2', 'my_acf_prepare_field');
    
    

    You only need to validate, if there is already a “good” url saved.

    Or you take a look here, and find yourself another filter 🙂

    https://www.advancedcustomfields.com/resources/#filters

  • If you dont want to create this repeater inside you live/devlopment page, create a seprate wordpress installation local.

    – Create the fields in a separate instalation
    – Copy/Paste the PHP Code
    – Export the json (for later)

    If you have to make changes later. Import the json in the separate installation, make the changes. Copy/Paste the php, and export the json also.

  • You could create a Repeater Field in Backend use the Export Tool to see how you can do it. A Repeater with a textfield looks like this.

    if( function_exists('acf_add_local_field_group') ):
    
    acf_add_local_field_group(array(
    	'key' => 'group_5c18f89ca825f',
    	'title' => 'repeater',
    	'fields' => array(
    		array(
    			'key' => 'field_5c18f8a29941c',
    			'label' => 'repeaterField',
    			'name' => 'repeaterFieldName',
    			'type' => 'repeater',
    			'instructions' => '',
    			'required' => 0,
    			'conditional_logic' => 0,
    			'wrapper' => array(
    				'width' => '',
    				'class' => '',
    				'id' => '',
    			),
    			'collapsed' => '',
    			'min' => 0,
    			'max' => 0,
    			'layout' => 'table',
    			'button_label' => '',
    			'sub_fields' => array(
    				array(
    					'key' => 'field_5c18f8ba9941d',
    					'label' => 'repeaterField-TextField',
    					'name' => 'repeaterfield-textfieldName',
    					'type' => 'text',
    					'instructions' => '',
    					'required' => 0,
    					'conditional_logic' => 0,
    					'wrapper' => array(
    						'width' => '',
    						'class' => '',
    						'id' => '',
    					),
    					'default_value' => '',
    					'placeholder' => '',
    					'prepend' => '',
    					'append' => '',
    					'maxlength' => '',
    				),
    			),
    		),
    	),
    	'location' => array(
    		array(
    			array(
    				'param' => 'post_type',
    				'operator' => '==',
    				'value' => 'post',
    			),
    		),
    	),
    	'menu_order' => 0,
    	'position' => 'normal',
    	'style' => 'default',
    	'label_placement' => 'top',
    	'instruction_placement' => 'label',
    	'hide_on_screen' => '',
    	'active' => 1,
    	'description' => '',
    ));
    
    endif;
  • Could you just add it to template file?

    <?php $value = get_field(‘page_layout’); ?>

    <body class=”<?php echo $value; ?>”>

  • Ok found it….
    Every layout Field has it own min/max option…

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