Forum Replies Created

  • I suggest adding the title via PHP and then hiding it with CSS and then when the div has class ‘selected-item’ display the title.

    <div class='slider-item'>
    <?php the_sub_field('image'); ?>
    <?php if(get_sub_field('title')){ ?>
    <div class='title'><?php the_sub_field('title'); ?></div>
    <?php } ?>

    Than in the css you can have

    .slider-item .title{display:none;}
    .item-selected .title{display:block;}

    Or something along those lines. Hope this helps.

  • Do you want to select all posts with the selected date from the form?
    If so you can use something like this:

    You can rework it for a meta_query like this:

    'meta_query' => array(
    		'key'       => 'other_information_%_date',
    		'compare'   => 'LIKE',
    		'value'     => $rep_date,
    		'type'      => 'DATE' //May not be necessary

    Hope that helps, or if you got another solution I would love to see it 😀

  • Hi Rafaromo,

    You could use this

    $args = array (
        'post_type' => 'YourPostType',
        'meta_query' => array(
    	        'key'		=> 'start_date',
    	        'compare'	=> '=',
    	        'value'		=> $TheDateYouAreLookingFor,
    // get posts
    $posts = get_posts($args);

    I got this from the ACF guide:

    The can also be used with the regular WP Query. The date you are looking for needs to be in the same format as the custom field date that is saved to the database.

    Hope this helps,

  • Hi John,

    Cheers for the help, I didn’t realise acf have a form. I solved it another way, by using ajax.

    	// This allows our page to have wordpress knowledge
    	define('WP_USE_THEMES', false);
    	$userid = $_REQUEST['userid']; 
    	$email = $_REQUEST['email'];  
    	$username = $_REQUEST['username']; 	
    	$pageid = $_REQUEST['pageid']; 	
    	$attendFB = $_REQUEST['attendFB']; 
     $update_field = new WP_Query('showposts=1&post_type=tribe_events&orderby=date&order=ASC&p='.$pageid );
    					while ($update_field->have_posts()) : $update_field->the_post();
    	//get attending rows
    	if( have_rows('attending') ){
    		$gallery = get_field( 'attending' );
    	} else {
    		$gallery = array();
    	// add to existing array
    	$gallery[] = array(
    		'user_id'		=> $userid,
    		'name'	=> $username,
    		'email'	=> $email
    	// save new array
    	update_field("field_identifier", $gallery, get_the_ID());
    	endwhile;  wp_reset_query(); 
Viewing 4 posts - 1 through 4 (of 4 total)