Support

Account

Forum Replies Created

  • are you sure about the compare?
    it should only show dates that are currently ongoing (have a startdate today or inside the past, and a enddate of today or the future.)

    you could do it after query with php with code like that:

    <?php 
    $today = date('Ymd');
    $start_date = get_field('start_date');
    $end_date = get_field('end_date');
    if ((strtotime($today) >= strtotime($start_date)) && (strtotime($today) <= strtotime($end_date))) { //echo or something you like to do with the dates
    }
    ?>
    

    else, if you still need/wish to work with meta_value i can help you only with this info:
    date of datepicker inside DB is always build like 20150513 year month day without spaces, no matter what input or output format you give the date field with acf settings for that field.
    i am not sure if your $today has the same format/value. hope that help you to solve your problem.

    of your example dates it could only show the first (even if you would correct the 2051 to 2015)

  • should be possible,
    but definitely a complex nested loop that contains date-splitting and count is needed for that. also you probably need to build a own array before you echo something.

    my advise is build it at your own, or find/pay someone that can do it for you.

    the only help i can give is this tip:
    build a array and use this php-functions => date, strtotime, foreach, count

    //to get month or year
    $get_date = get_field('datefield');
    $get_date_month = date('m', strtotime($get_date));
    $get_date_year = date('Y', strtotime($get_date));
    
    //build a array out of lesson, year, month and day, something like that
    // $array[$lession][$year][$month][$date]
    // then use a foreach loop with count on month to build your table
  • did this solve your problem:

    $embed_code = '';
    $embed_code = get_sub_field('embed_code');

    i think you need to clear the variable, else it still has the value of the last entry at next loop

  • @tmconnect like i say at opening post: modify only the toolbar is not enough for me. thats why your post dont help. and if you read carefully you will see that problem is made by ACF, thats why i also cant use tiny_mce_before_init filter. that work for/with default wysiwyg.


    @elliot
    any toughts, comment or help for this problem?

    or is someone else able to help me, without to modify corefiles?

  • as far as i understand the array should be:

    array(
    			'key' => 'display_in_carousel',
    			'value' => '1',
    			'compare' => '='
    		)

    because true/false should have value 1/0, compare should maybe = instead of == (i am not sure, try out both and one should work)
    i dont work long time with wordpress, that’s why i am not that familiar with meta_query

  • it depends where and how you load the data of this contacts table. if you load it at the right place you dont need to remove the default genesis loop.

    else you may need to use remove_action and and add_action and replace a genesis loop with a own loop

  • try something like this:

    <ul class="slider">
    <?php if( get_field('display_in_carousel') )
    {
    $image = get_field('image'); 
    if( !empty($image) ): ?>
    	<li><img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /></li>
    <?php endif; 
    }
    else
    {
        //do nothing
    }
    ?>
    </ul>

    of course you need to wrap that like your slider need it (and probably change way of load image too)

    or you do it with meta-query like the other part of the example

  • please when you post code:
    wrap code with code tags (at top over textfield where you write your forum-post-entry you have code mark your code and press that button, than it will be formatted, much better for readability. do that before first submit.)

    (if) you have forgotten that:
    please edit your post, copy-paste code form original and replace existing not formatted code, mark new inserted code and click on code. save/submit forum post again

    hard to say what is wrong when you say one slider works with the same code. one thing i had to ask is: did slider support multiple instances on same site?
    if yes, we probably cant help without link to frontpage where we may can see more (for example if there are some js or css problems)

  • $term_link = get_term_link( $term ); could not work because $term is set inside the foreach loop. (dont think that is the main problem, but it would be one of the possibilities why it not work.)

    and you have “the same” a custom post that work with the others taxonomies?

  • i think it should maybe possible.
    take a look at this and this

    you need a relationship field at user or/and at author.

    because you should be able to query relationship fields in both directions. you can
    show users at author page, and show author details at user page (at least if users and authors are CPTs)

    but to get it working you need advanced php/ACF/WP knowledge. if you are unable to adapt the example for your needs, you probably need to hire someone to do it for you.

  • just to get sure: you have no problem to show the gallery at the taxonomy page?
    but you wish to show only the first image from that gallery?

    have you try something like that?:

    <?php 
    $images = get_field('gallery_images');
        if( $images ){ 
            $image_1 = $images[0]; 
    }
    ?>
    <a href="<?php echo $image_1['url']; ?>">
     <img src="<?php echo $image_1['sizes']['large']; ?>" alt="<?php echo $image_1['alt']; ?>" />
    </a>
  • How is the data saved?

    The repeater field saves all it’s data in the wp_postmeta table. If your repeater field is called “gallery” and contains 2 sub fields called “image” and “description”, this would be the database structure of 2 rows of data:

    // meta_key meta_value

    gallery                      2                 // number of rows
    gallery_0_image              6                 // sub field value
    gallery_0_description        "some text"       // sub field value
    gallery_1_image              7                 // sub field value
    gallery_1_description        "some text"       // sub field value

    that means:
    try this:

    $post->repeater_0_subfield //for first row
    $post->repeater_1_subfield //for second row
    ...

    or create a foreach or a while loop: described here

  • maybe that work. (when my interpretation of that sample was correct)

    <?php 
    $images = get_field('gallery');
    $img_count=1;
    if( $images ): ?>
        
            <?php foreach( $images as $image ):
    if ($img_count == 1) { ?>
    <div id="imageview">
                    
                         <img src="<?php echo $image['sizes']['large']; ?>" alt="<?php echo $image['alt']; ?>" />
                                   
                </div>
    <div id="thumbnails">
    <a class="active" href="<?php echo $image['url']; ?>">
                         <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
                    </a>
    <?php } else {?>
                
                    <a href="<?php echo $image['url']; ?>">
                         <img src="<?php echo $image['sizes']['thumbnail']; ?>" alt="<?php echo $image['alt']; ?>" />
                    </a>                
                
    <?php } 
    $img_count++; ?>
            <?php endforeach; ?>
    </div>
    <script type="text/javascript"> 
        jQuery(document).ready(function() { 
            $('#thumbnails').simplethumbs({slideshow: '#imageview'}); 
        }); 
    </script>     
    <?php endif; ?>

    probably you also need to load additional simplethumbs js somewhere.

    test it and give feedback

  • you could do it after query with php with code like that:

    <?php while($event->have_posts()) : $event->the_post(); 
    $today = date('Ymd');
    $event_date = get_field('date');
    if (strtotime($today) <= strtotime($event_date)) {
    ?>
    <li>
     Posted on: <?php the_field('date'); ?><a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    </li>
    <?php } endwhile; ?>

    else you need to work with meta_value that is always build like 20150430 year month day without spaces, no matter what input or output format you give the date field with acf settings for that field.

  • it is possible but you need to rebuild/change your code.
    you need to fill first all rows to variables or a array.
    and use that to echo values. (here i use variables)

    simple it would look like that:

    <?php
    $count = 0;
    $list_employee = '';
    $div_employee = '';
    while ( have_rows('employees') ) : the_row();
    $count++;
    $list_employee .= '<li><a href="#employee-'; //whole code for li (no echo!, nothing outside php, get_field instead of the_field)
    $div_employee .= '<div id="employee-'; //whole code for div (no echo!, nothing outside php, get_field instead of the_field)
     if ($count % 5 == 0) { //each 5 rows echo ul and div
    echo '<div class="tabz"><ul class="employees">';
    echo $list_employee;
    echo '</ul>';
    echo $div_employee;
    echo '</div>';
          $list_employee = '';
          $div_employee = '';
       }
    endwhile;
    if ($list_employee){ //if all rows are done but 1-4 rows left, echo them
    echo '<div class="tabz"><ul class="employees">';
    echo $list_employee;
    echo '</ul>';
    echo $div_employee;
    echo '</div>';}
    ?>

    try to modify your code like above, just the whole one. this should work.
    if not: show whole modified code and what the “error/problem” is.

  • primary it should work with help of php function shuffle.
    but you need to rebuild your code and replace the while loop with a foreach loop to use it.

    here is a simple code how to use randomize(shuffle):

    <?php 
    $rows = get_field('repeater_field_name' ); //get all rows
    shuffle ($rows); //randomize rows
    if($rows) {
    	foreach($rows as $row) { //print rows
    		echo $row['sub_field_name'];
    		echo ' ';
    		echo $row['sub_field2_name'];
    		echo '<br>';
    	} 
    }
    ?>
  • if we are lucky it works when you change this line
    <?php $i++; } endforeach; ?>
    the counter should only go up when image is featured,
    thats why it should be inside the featured loop and not outside like you have it now

  • just to get sure. you wish:

    <div class="tabz">
    //ul with 5 rows employees
    //div with 5 rows employees
    </div>
    <div class="tabz">
    //ul with 5 rows employees
    //div with 5 rows employees
    </div>
    ...

    and both (ul and div) use same repeater

  • you need to add the css&js from link you have from documentation
    you need the the full code from : Required CSS & JS
    just customize it when you know what you do

    and full code from : Render a single maker onto a map
    just change location from the code get_field('location'); to the field-name you use

    of course you can add css part to template-css and outsource the js part into a file and use wp_register_script and wp_enqueue_script to include it.

  • just to get sure:
    you check frontpage for a page/post/custom-post where you have some content filled at backend. either photo or text.

    <?php
    
    // check if the flexible content field has rows of data
    if( have_rows('travel_gallery') ):
    
         // loop through the rows of data
        while ( have_rows('travel_gallery') ) : the_row();
    
            if( get_row_layout() == 'travel_text_row' ){
              $get_travel_text = get_sub_field('travel_text');
              echo $get_travel_text;
              echo '<br>normally above should stand the text';
            }
    
            if( get_row_layout() == 'travel_photo_row' ){ 
              $get_travel_photo = get_sub_field('travel_photo');
              echo $get_travel_photo;
              echo '<br>normally above should come the image';
            }
    
        endwhile;
    
    else :
    
        // no layouts found
      echo 'no layouts found';
    
    endif;
    
    ?>

    your code look correct. but what is the result when you use mine instead?

  • most easy way would probably be:
    he should upload those image again/twice, and use one time the first image, and one time the second image.

    a other way would be:
    work with a repeater and image field instead of gallery field

    a other way would be:
    use a repeater field with a gallery inside and each time he wish to reuse a image he need to create a new gallery. and you create a single slideshow out of those gallerys at/for frontend. (probably a little more complicate loop than now)

    or:
    create your own gallery-field plugin. i think it would need at least 2 fields one that contains the image-pool, and one that contains the slideshow. also a upload functionality and a way to remove add and ordering the images inside the slideshow

  • for a next time:
    with only a image for debug the problem it is nearly impossible to help.
    without any code, fields you use … (maybe url to site) everything is only guessing.

  • you need to check/correct this 2 lines

    $blubb = '[gallery ids="';
    $blubb .= '"]';

    and maybe you need to use do_shortcode instead of echo $blubb
    do_shortcode($blubb);

  • $row_count-1; would not work because you dont save result back to a variable.
    $row_count_last = $row_count-1; should work 😉
    (you can use same variable like previous post, or a new one like this post)

    for second last you could use different ways.
    it depends on things like: do you use last row anyway.

    $row_count--; // because first row start with 0 not 1 subtract one from row number
    $lastrow_content =  'testimonials_'.$row_count.'_testimonial'; //get last row field
    $lastrow_head = 'testimonials_'.$row_count.'_testimonial_header'; //get last row field
    $row_count--; // because we already subtract 1, this is like subtract 2 from start value
    $2lastrow_content =  'testimonials_'.$row_count.'_testimonial'; //get 2last row field
    $2lastrow_head = 'testimonials_'.$row_count.'_testimonial_header'; //get 2last row field

    above only works when variable for last row is filled before.
    (it use $row_count--;)
    below works independent of ordering, last could be before or after 2last
    (this dont use $row_count--; !)

    $row_count_2last = $row_count-2;
    $2lastrow_content =  'testimonials_'.$row_count_2last.'_testimonial'; //get 2last row field
    $2lastrow_head = 'testimonials_'.$row_count_2last.'_testimonial_header'; //get 2last row field
    $row_count_last = $row_count-1; // because first row start with 0 not 1 subtract one from row number
    $lastrow_content =  'testimonials_'.$row_count_last.'_testimonial'; //get last row field
    $lastrow_head = 'testimonials_'.$row_count_last.'_testimonial_header'; //get last row field

    or you could do it a other way 😉 (fill your own array and echo that for example)

  • probably added by code that you use to display the images

Viewing 25 posts - 51 through 75 (of 181 total)