Support

Account

Home Forums Search Search Results for 'q'

Search Results for 'q'

reply

  • Hi! I get

    Warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/zaneupuc/public_html/dzek/putujzajedno/wp-content/plugins/advanced-custom-fields/core/api.php on line 1100

    Warning: Invalid argument supplied for foreach() in /home/zaneupuc/public_html/dzek/putujzajedno/wp-content/plugins/advanced-custom-fields/core/api.php on line 1104

    and no update button and how to create form for addming new post?

  • This reply has been marked as private.
  • Hi @tjb1013

    This is a good question, and one that can be accomplished with some simple PHP.

    What you want to do is loop through your posts, load the custom field data, and then add them to the appropriate array. Then loop through this new array and display the data like so:

    
    <?php 
    
    // vars
    $posts = array( /* this is the array which holds all your posts. */);
    $sorted = array();
    
    // loop through posts
    foreach( $posts as $p )
    {
    	// load custom category:
    	$cat = get_field('trend_category');
    	
    	
    	// add to $sorted
    	if( !isset($sorted[ $cat ]) )
    	{
    		$sorted[ $cat ] = array();
    	}
    	
    	$sorted[ $cat ][] = $p;
    }
    
    // now loop through sorted
    foreach( $sorted as $cat_name => $cat_posts )
    {
    	echo '<h3>' . $cat . '</h3>';
    	
    	echo '<ul>';
    	
    	foreach( $cat_posts as $p )
    	{
    		echo '<li>' . get_the_title( $p->ID ) . '</li>';
    	}
    	
    	echo '</ul>';
    }
    
    ?>
    

    Please note the above code is untested and does not include any fail safe if statements. I hope it helps you understand how to solve your task.

    Good luck!

  • This reply has been marked as private.
  • Okay, after some work I have managed to get it calling the needed aspects

    now the question is:

    How can I get it to display taxonomies rather then then just outputting the code the database uses and how can I stop it from listing any array field as just the word Array.

    Here is my code so far:

    <?php
    global $post;
    $postid = $post->ID;
    $systemon = get_field(“played_on”, $postid);
    $score = get_post_meta($postid, ‘editor_score’, true);
    echo ‘<div class=”system”>’;
    echo __(‘Payed On: ‘).’ ‘.$systemon;
    echo ‘</div>’;
    echo ‘<div class=”editorscore”>’;
    echo __(‘Editor Score: ‘,’taxonomies-filter-widget’).’ ‘.$score;
    echo ‘</div>’;
    ?>

  • There no direct errors on the site….
    My Function.php afc part

    function my_pre_save_post( $post_id )
    {
        // check if this is to be a new post
        if( $post_id != 'new' )
        {
            return $post_id;
        }
     
        // Create a new post
        $post = array(
            'post_status'  => 'draft' ,
            'post_title'  => 'A title, maybe a $_POST variable' ,
            'post_type'  => 'post' ,
        );  
     
        // insert the post
        $post_id = wp_insert_post( $post ); 
        $targetCatgogry = array( 4 ); 
        wp_set_post_terms( $post_id, $targetCatgogry);
        // update $_POST['return']
        $_POST['return'] = add_query_arg( array('post_id' => $post_id), $_POST['return'] );    
     
        // return the new ID
        return $post_id;
    }
     
    add_filter('acf/pre_save_post' , 'my_pre_save_post' );
    

    My template page php afc

    <?php
    acf_form_head();
    the_post();
    
    $args = array
    (
    	'post_id' => 'new',
    	'field_groups' => array(182, 368)
    );
    
    acf_form( $args ); 
    ?>
  • I checked the log… if you mean setting debug to true… and only had alot of undefined variables in other plugins nothing specific to acf..

    [05-Sep-2013 15:45:23] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:23] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:23] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:24] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:24] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:24] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:24] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:25] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:25] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:26] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:27] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:28] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:28] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:29] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:29] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:33] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:33] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:33] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:33] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: FollowerCounterWidget::$version in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 190
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 348
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tabActive in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1884
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: tab_type in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 1892
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined property: WP_Query::$post in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 41
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 42
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 44
    [05-Sep-2013 15:45:34] PHP Notice:  Trying to get property of non-object in D:\Hosting\11702510\html\wp-content\plugins\digg-digg\digg-digg.php on line 45
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined variable: options in D:\Hosting\11702510\html\wp-content\plugins\facebook-members\facebook-members.php on line 73
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:34] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined variable: control_ops in D:\Hosting\11702510\html\wp-content\plugins\social-media-followers-counter\social-counter.php on line 21
    [05-Sep-2013 15:45:44] PHP Notice:  Use of undefined constant cgview - assumed 'cgview' in D:\Hosting\11702510\html\wp-content\plugins\category-grid-view-gallery\includes\Options.php on line 38
    [05-Sep-2013 15:45:44] PHP Notice:  has_cap was called with an argument that is <strong>deprecated</strong> since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. in D:\Hosting\11702510\html\wp-includes\functions.php on line 2969
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: ssl_check in D:\Hosting\11702510\html\wp-content\plugins\slidetabs\slidetabs.php on line 259
    [05-Sep-2013 15:45:44] PHP Notice:  Undefined index: tr_on in D:\Hosting\11702510\html\wp-content\plugins\toolbar-remixed-free\toolbar-remixed-free.php on line 317
    
  • Ah that’s perfect. Thank you for sharing!

    It also works when you try to re-order the menu too.

    function custom_menu_order($menu_ord) {
    	if (!$menu_ord) return true;
    	
    	return array(
    		'index.php', // Dashboard
    		'separator1', // First separator
    		'edit.php?post_type=page', // Pages		
    		'edit.php', // Posts		
    		'upload.php', // Media
    		'acf-options', // ACF Options
    		'separator2', // Second separator
    		'users.php', // Users
    	);
    }
    
    add_filter('custom_menu_order', 'custom_menu_order');
    add_filter('menu_order', 'custom_menu_order');
  • Hi Elliot

    I do know how to use it (create a custom field and display it live on the Internet) and it works on one of my other themes. Not knowing how to use it is not the problem. It showing live on this theme ( http://www.industrialthemes.com/made/) that is the problem.

    The problem is it does not work on this theme. Meaning when i click the preview or the update button in WP using this theme – the content of the custom field does not appear, but it does with another theme.

    I would not know what code you would need to see – as i do not know why it is not working. Please do not worry about this question.

    I have reread the documentation and tried to apply what i have read, but it will not display the field and its content on the live webpage.

    Again, it does work in another theme but not this one ( http://www.industrialthemes.com/made/)…….meaning i can create a field but not display it live on the net.

    Thanks for your help.

    Jason

    P.S. It may be this plug in does not work on all themes or a person can get it to work if they know what coding to change, which i don’t and is fine with me, but i thought i would try and see if someone knows a solution.

  • Hi @aaronjpitts

    At the end of the day, all you need to do is set some $_GET variables from input fields, then use them to create a WP_Query with args available.

    I can’t be of much help other than that, but wish you good luck!

    Thanks
    E

  • Hi @jasej

    Your question is extremely vague and demonstrates that you don’t understand what this plugin is or how it works.

    What code to remove and what to add?
    Without seeing any code in your theme, I have absolutely no idea how to respond to this.

    The documentation articles have been written to clearly explain how to use this plugin. Please read the documentation, then feel free to ask questions.

    Thanks
    E

  • Hi @bradwiatr

    Time frame for both repeater and flexible content is within 1 to 2 months.

    For now, you could modify the existing add-ons and remove the functionality which creates the update class. You will find the code quite easily in the main plugin file.

    As long as there is no update functionality, I’m happy for you to include all add-ons in your theme

    Thanks
    E

  • Hi @sirjonathan

    Looks like the simplest answer was hooking in and adding the custom fields like so:

    
    add_filter('json_api_encode', 'json_api_encode_acf');
     
    function json_api_encode_acf($response) 
    {
        if (isset($response['posts'])) {
            foreach ($response['posts'] as $post) {
                json_api_add_acf($post); // Add specs to each post
            }
        } 
        else if (isset($response['post'])) {
            json_api_add_acf($response['post']); // Add a specs property
        }
     
        return $response;
    }
     
    function json_api_add_acf(&$post) 
    {
        $post->acf = get_fields($post->id);
    }
    

    http://wordpress.org/extend/plugins/json-api/other_notes/#Filter:-json_api_encode http://stackoverflow.com/questions/10132685/json-api-to-show-advanced-custom-fields-wordpress

    The code is so small that I could not charge for it. Maybe you could package it up into a WP plugin?

    Thanks
    E

  • Hi @justintoon

    Sorry mate, I have not used Capistrano before, or used WP with a modified folder structure.

    Sounds like you may need to ask this q on stack exchange to find a dev that knows what to do.

    Good luck

    Cheers
    E

  • +1 – This would be quite useful.

  • I ran into the same problem and while debug stepping through how the options page menu item is registered and named I discovered it’s not admin.php?etc. but rather just ‘acf-options’. This works for me:

    add_action('admin_init', 'remove_acf_options_page', 99);
    function remove_acf_options_page() {
       remove_menu_page('acf-options');
    }
  • Elliot,

    Thanks for the quick response. I had already read the 2 articles you listed above and successfully implemented lite-mode (thanks for making it simple!).

    I want to clarify the legal issue: You are stating that it is NOT within the scope of the license to package the repeater and flexible content field add-ons with my theme at this time, correct?

    My framework is currently ready for release, but I obviously want to make sure everything is legit. Do you have an estimate of when packaging these add-ons will become possible? Is there any other option for me short term until the add-on updates are made?

    It might be worth noting, that I’m selling my framework as part of an education package that includes a seminar. I’m not sure if it would make distribution legalities different, but it won’t be available for sale on sites like Themeforest or WordPress.

    Thanks!

  • Thank you so much for your reply. I have one more question though, because I’m clearly not grasping the proper syntax…

    The code is being pulled into an IMG SRC tag like this:

    ” alt=”” />

    So the code I’m entering is:

    <img src=”

    <?php if( get_field(‘secondary_featured_image’) ); ?>
    <?php the_field(‘secondary_featured_image’); ?>
    <?php else: ?>
    <?php echo get_option(‘home’); ?>/wp-content/themes/vistaverde/images/main-photo-bg.jpg” alt=”Vista Verde Ranch, Colorado Luxury Ranch” title=”Vista Verde Ranch, Colorado Luxury Ranch”/>
    <?php endif; ?>

    But it’s not working. I know it’s got something to do with the closed quotations from the IMG SRC. I’m not putting them in the right place. Can you help? Also, just to clarify, your example has a colon at the end of the first string. Should I be changing that to a semi-colon?

    Thank you again for your reply!

  • Perfect that worked excellently!

    One other question.

    Is there a way to filter out specific field groups with this code? I know there are ways to use the postID to show the groups, but what if we want to show all associated with a post, except one group?? Does that exist?

  • Never mind, that worked that time.

    This seems to be spotty – anyone had experience with this? It worked, and then it quit.

    Help!

  • Thank you Elliot, this worked beautifully.

  • OOOOO, i thought you were referring to my second query, with the original I have to activate another theme make changes to the plugin and then re-activate the theme that I am working with.

    If I make changes to the custom fields whilst the main theme is active it removes everything.

  • Hi @Krissy S.

    No worries, here is the example from the docs with some extra PHP to create a counter:

    
    <?php if(get_field('repeater_field_name')): $i = 0; ?>
    
    	<ul>
     
    	<?php while(has_sub_field('repeater_field_name')): $i++; ?>
    		
    		<li class="section-<?php echo $i; ?>">
    			sub_field_1 = <?php the_sub_field('sub_field_1'); ?>, sub_field_2 = <?php the_sub_field('sub_field_2'); ?>, etc
    		</li>
     
    	<?php endwhile; ?>
     
    	</ul>
     
    <?php endif; ?>
    
  • Hi @davelee

    Your jQuery does not take into account for new DOM elemenets.

    You need to use .live or the new .on function to allow for new DOM elements.
    Perhaps you could checkout the ACF JS file (input.js) to see how I add JS events to elements?

    Thanks
    E

  • Hi @synergywp

    Do you have any required fields? Is this an issue with the plugin, or is the plugin rightly validating the fields?

Viewing 25 results - 20,626 through 20,650 (of 21,339 total)