Support

Account

Forum Replies Created

  • Rather a read the documentation for the upgrade from version 4 to 5 ;)))))

    See here: http://www.advancedcustomfields.com/resources/updates/upgrading-v4-v5/

    The relevant part:

    Changes to Options Pages
    Previously, the default Options page was added automatically on activation of the Options Page add-on. Now that the Options Page functionality is built into ACF PRO, this will no longer be an automatic process, and the default Options Page will need to be added manually by adding this code to your functions.php file:

    acf_add_options_page();

    It is good practice to wrap this inside a function_exists if statement and above any defined sub pages like so:

    if(function_exists('acf_add_options_page')) { 
     
    	acf_add_options_page();
    	acf_add_options_sub_page('Header');
    	acf_add_options_sub_page('Footer');
     
    }

    Best regards Ralf

  • Ok i got it working somehow but i have only two follow up questions regarding the initial problem and the new code. The working snippet looks like that:

    <div class="acf-map"><?php
        $terms = get_field('op-contact-tax', 'option');
        $args = array(
          'post_type' => 'locations',
          'posts_per_page' => -1,
        );
    	$the_query = new WP_Query( $args );
    	if( $the_query -> have_posts() ) : while ( $the_query -> have_posts() ) : $the_query->the_post();
            $termstd = get_the_terms($post->ID, 'thelocations');
            $termsingle = array_shift( $termstd );
            foreach($terms as $term):
            	if( $termsingle->term_id == $term ) {
            	$location = get_field( 'location_gmap' );
            	$termdesc = term_description($term, 'thelocations'); ?>
            	<div class="marker" data-lat="<?php echo $location['lat']; ?>" data-lng="<?php echo $location['lng']; ?>" data-col="<?php echo $termdesc; ?>">
                	<h5><?php the_title(); ?></h5>
                	<p class="address"><span><?php echo the_field( 'location_street' ); ?></span><span><?php echo the_field( 'location_postalcode' ); ?></span> <span><?php echo the_field( 'location_city' ); ?></span></p>
                	<?php $locurl = the_field( 'location_url' );
                	if(!empty($locurl)) { ?>
    		    		<a><?php echo $locurl; ?></a>
    		    	<?php } ?>
                </div>
          	<?php }
        	endforeach;
        endwhile;
    		wp_reset_postdata();
        else: ?>
            <p>Error</p><?php
    	endif; ?>
    </div>

    The questions:
    1) Would it be possible to move the closing div at the end, a bit upwards, between the endforeach and endwhile so that it would be possible to query within the same loop for more informations which don’t go into the google maps map. I mean you have the loop, within the loop you query for the informations of the google maps block and then also query for blocks of addresses underneath the google maps part and then close the loop. Or do i have to create two separate loops (one for google maps one for addresses). cuz if i move the div up right after the endforeach there is no map displayed anymore.

    2) Is it possible to solve the issue in a more elegant way. For me the code looks a bit messy.

    Best regards Ralf

  • Ok i think i’ve figured things out. If anyone knows a more clean way i would be curious how to accomplish but for the moment the following just works out fine. Best regards Ralf

    <figcaption class="bottombox fp-bb">
    	<h3 class="bran-bn fp-pro-title"><?php the_title(); ?></h3>
    	<?php
    	if(have_rows( 'pro_services' ) ): ?>
    	<ul class="mus-li fp-pro-serv">
    	<?php
    	$fp_list_slice = array_slice( get_field('pro_services'), 0, 2 );
    	foreach($fp_list_slice as $fp_list_count) { ?>
    		<li class="fp-lister"><?php
    		echo $fp_list_count['pro_service_single'];
    		?></li><?php } ?>
    	</ul>
    	<?php endif; ?>
    	<p class="fp-pro-excerpt"><?php acf_excerpt( 'pro_description', 20, ' <span class="fp-pro-more">[...]</span>' ); ?></p>
    </figcaption>
  • Yes for example. As i said basically i am unsure what would be the most elegant solution to head for with acf but basically i would like to have two options. On one hand get the link to the next or previous post_id to be able to load that specific post as you said ( like with next_posts_link and pervious_posts_link) and on the other hand to build something like on the screenshot i initially pasted, based on pagination_links. Or are both scenarios already possible in acf today and i was just blind? best regards r.

  • Sorry for the delayed reply. And i have to admit my wording and explanation in my initial post wasn’t the best (maybe cuz i am still not an expert on php and wordpress matters – am still in order to learn and dive into things 😉 ) . Basically it would be already perfect to offer the functionality pagination_links, next_posts_link and previous_posts_link provides that the visitor of a webpage is able to get to the previous or next post as well as offering. Cuz so far it seems impossible to use advanced custom fields with those three native wp functions. best regards r.

  • On the front-end: If the functions would behave like the three mentioned wp functions it would be already enough imho. At the moment it is impossible to get the three working with acf fields e.g. if you try to build a custom blog functionality, that you are able to either jump back and forth to the next or previous article or get a pagination like that
    paginationnav

    on the backend: it would be more than useful if you are inspecting an object of a custom post type like projects and then would be able to jump to the next object instead of go back to the main list of objects of the custom post type and jump into the detailed view of the next object. would save a lot of time for the user in the backend.

  • Thanks too Elliot!!! I was trying and searching the forums across the net for a solution for my hassle about a custom excerpt function for a acf wysiwg field for weeks. The combination of add_filter(‘acf_the_content’, ‘wpautop’); and
    the_field(‘wysiwyg_field’, false, false); saved me. Drove me crazy 😀

  • i don’t know why and how, i’ve only pasted the content into the wysiwg field and did nothing but somehow one news post (actually the one i tested around with) got pre instead of paragraph assigned in the lower left of the rte field. :/ problem solved.

  • ok i figured it out and solved it. it wasn’t a wordpress nor a wordpress plugin issue. was a server issue on my side i couldn’t have thought of. sorry.

  • I totally understand that.nothing worse than cutting a feature many people use. but i only ask myself one question. what image size is wordpress actually using if you select e.g. thumbnail even if it is unset in the functions.php. e.g. the preview size was set by default to thumbnail on my side and the image size used looked much much bigger than the thumbnail size i would have expected. i just rechecked it. if you set the preview size to thumbnail and it is unset acf and wordpress use the full size instead. same procedure if you use medium or large. always the full version is used instead of the unset one.

  • @elliot that kind of “filter” functionality would be more than welcome 🙂 best regards ralf

  • yeah i understand that, breaking things in existing websites wouldn’t be an option at all. but wouldn’t be a check of the set sizes before the previews sizes list is generated the most secure approach and prevent troubles like that? thanks r.

  • hi elliot. well in the first place it was a concern that the standard sizes haven’t been unset and removed properly and that that that might lead into troubles in the long. also i was worried that wordpress might create those image sizes too and clutter my uploads folder with unwanted weight.

    the other concern has vanished. i was just worried in the case e.g. “medium” gets selected as preview size and this image size doesn’t exist it might lead into trouble. you never know what the user in front of wp might actually do. 😉 but i’ve tested, i am using the unset thumbnail format and afc is previewing the image properly anyway. so that part is probably ok. and there are still only the image sizes i’ve defined inside the uploads folder.

    those points aside but wouldn’t it be cleaner anyway if acf would pull the formats of preview sizes dynamically from the list of available sizes. in the case thumbnail, medium and large are unset they couldn’t show up. just looks odd and confusing 😉 , but i know it behaves right so it is ok if know about that behaviour.

  • you were right. the reason were settings in custom post types ui. under advanced options built in taxonomies are deactivated by default. my bad. sorry and thanks for the hint!

  • a bit more infos. if i uncheck all boxes and go to a custom post type the following is shown:

    permalink
    wysiwg
    revisions
    comments
    publish
    attributes

    the rest seems missing

  • thanks @elliot ! i guess i’ve the wrong search queries – including resolution lead into nowhere. :/

    about your link, unfortunately the suggested functions.php filter isn’t viable in my use case – one global minimum image dimension won’t do the trick. I hoped it would be possible to set image dimensions for each image field separately. I have implemented a responsive image solution including retina images as well and i wanted to take care that the user who is uploading the images isn’t uploading a too small version for a specific image field by accident, which might lead to image drop outs or other oddities.

    would it be possible to make a feature request for the acf and the repeater plugin? i think it would be a neat and useful feature – or what do you think about? best regards Ralf

  • Cool cool cool – thanks a lot!!! Works fine now! But your answer also brought up a bit of a dumb follow up question i suppose. I query two repeater fields in this example – one text and one image repeater field. Why do I have to use the_subfield on the text field:

    <li><?php the_sub_field( 'pro_service_single' ); ?></li>

    and get_sub_field on the image field?

    <?php $projectimages = get_sub_field('pro_impressions'); ?>

    Is it cuz the second query is about an image object which gets passed to an array and the first is just a plain query? Thanks again for the fast response and help. Best regards Ralf

  • Hi Elliot, that was just a general question, not that you already cover that kind of functionality in one of your premium plugins (i’ve overseen that already in one of my previous posts in here where you’ve pointed me to the repeater field – thanks again for that, the repeater field rocks). But indirectly you’ve answered my initial question here, since otherwise you’ve pointed me to one of your plugins. 😉 And I’ve already asked on stackoverflow but no useful answer yet. But finally had a new idea today which actually might work – implementing it right now and it seems to work. I only might have a follow up question, 100% acf related, later tonight, if I am unable to manage to get one specific thing working. But i will open a separate thread for it then. 😉 Thanks for now. Best regards Ralf

  • I’ve rethought the process again – basically the ideal solution would be based on the context the images are uploaded into (via which post type and which custom field the upload takes place) that the necessary breakpoint set is automatically applied and the custom set of images is generated accordingly.

  • ahhhhhhhhhhhhhhhh as i suspected, i got something horrible wrong with my interpretation of the docs examples. thanks!!! it’s working now.

Viewing 22 posts - 26 through 47 (of 47 total)