Support

Account

Forum Replies Created

  • It doesn’t work that way, but let’s pretend it did. I have a Boolean (True / False) field called “Show Me” that says if “Show Me” is True, show the field. This means that if “Show Me” is ever switched to False, then it would get hidden… forever (until you dug unto the database, but that’s neither here nor there).

    The Conditional Logic for each field is for showing or hiding THIS field based on input from other fields.

    In a more real world example, I create a few different fields. One called “Background Color”. One called “Background Image”. And one called “Background Video”. Above those three a create a radio button field that is called “Background Type” with the options of color, image, and video. I then add conditional logic to the “Background Color” field that says if “Background Type” is equal to color, show this field. Then I do the same for the other two background fields. You are now hiding unnecessary fields in your editor UI.

  • A field cannot use itself for Conditional Logic. You would add these rules to dependent fields.

  • Might need some more information to help you out with this one. You can start by looking at the ACF field groups, ad find out which one is responsible for the sliders fields. Then you can see the rules for that field group to find out where the fields are being displayed. If I had created this, I would name the field group something like “Slider-Options” and assign these fields to the Home page. Actually I would create a custom post type for the sliders, but thats a personal preference and doesn’t sound like what’s happening here or else there would be a “Sliders” option in the left tabs.

    Another thing I would check, as you’re still new to WP, there is a tab on the top right of every page labeled “Screen Options”. Your slider options may just be hidden from the home page with the screen options.

  • Repeater v. 1.0.1 examples

    1024px
    v101 - 1024px

    1280px
    v101 - 1280px

    1440px
    v101 - 1440px

  • For reference, I threw together a test page with a nested repeater with an unmodified version 1.1.0. Here are the results…

    1024px
    1024 Browser Width

    1280px
    1280 Browser Width

    1440px
    1440 Browser Width

    Anything wider and it’s not an issue, but I can’t reasonable expect all clients to have anything larger than 1280.

  • There’s nothing within ACF to allow such functionality. However, you could link to the files within password protected pages. No additional plugins required. This doesn’t secure the files directly, as anyone who knows the URL to the file will have access.

  • Glad I could help jrstaatsiii.

    As requested, here are some before and after images. These where taken from a 1280×900 screen. Even with the nested repeaters there should be plenty of room for the UI.

    Before: Nested repeaters version 1.0.1 and prior…

    Nested repeaters vr. 1.0.1

    After: Nested repeaters version 1.1.0…

    Nested Repeater fields after 1.1.0 update

  • Elliot,

    I had a similar issue with the recent update as well. Client’s site has repeaters within repeaters and they complained that the fields would extend beyond as well as beneath the containing borders causing the wysiwyg fields to be unusable.

    My initial thought was “your screen is just too small”. Looked into it a little more in-depth and compared it to a cloned site on the version 1.0.1 repeater plugin. It turns out that there was a change in the 1.1.0 css that was causing the issue.

    On line 5 of the input.css file you have

    table-layout: fixed;

    If I comment out this line, the editor displays as expected (expected by the client).

    For my client I’m overriding this style attribute with a custom filter in my functions.php.

    function admin_css() { ?>
    	<style type="text/css">
    		.repeater > table{
    			table-layout:auto!important;
    		}
    	</style>
    <? }
    add_action('admin_head', 'admin_css');

    That should hold them over and even help with future updates, but could you explain the reason for this simple style change? Is my modification going to come back and bite me?

    Thanks,

  • By default, ‘medium’ should return a scaled down and un-cropped image. And I don’t know why “full” wouldn’t work for you either.

    Give this a try. Set your Return Value to Image URL and call it like this…

    <?php the_field('ceo_background'); ?>

    This will return the URL to the un-cropped, unscaled image. If you see that it’s scalled down or cropped, then you know that either the JS or CSS is modifying the returned image.

  • You need your Investment Logo field to return the “Image ID” and not the “Image Object”

    Image ID

  • Just a suggestion, but would it be possible for you to enter hypothetical date for the release of the film but also have a check box field for “To Be Determined”. That way, the entry will still sort in your lists but the date that you insert will be replaced with “To be determined” in the page view?

    <span class="release_date">
      <?php if get_field('tbd'){?>
        To be determined
      <?php }else{ 
        the_field('release_date') };
      ?>
    </span>

    This might only be a duct-tape solution and there is probably a better answer to this, but it should work for the time being.

  • “custom-size” needs to be defined in the functions.php file of your theme. It will look something like this…

    /**
     * Add automatic image sizes
     */
    if ( function_exists( 'add_image_size' ) ) { 
    	add_image_size( 'post-feature-img', 770, 120, true ); //(cropped)
    	add_image_size( 'member-img', 200, 200, false ); //(scaled)
    	add_image_size( 'people-img', 360, 360, true ); //(cropped)
    	add_image_size( 'people-featured-img', 150, 120, true ); //(cropped)
    }

    If you’ve already uploaded images to your library you’ll need to re-process them with something like Ajax Thumbnail Rebuild…
    http://wordpress.org/plugins/ajax-thumbnail-rebuild/

    Now I create a field called “Bio Image” with a name of “bio-image” and set it to return the Image ID of the uploaded file.

    After the images have been resized by WordPress and I create my field I can add code to my theme.

    Assuming this is in a loop that returns a list of bios and I want each of them to have an image of an employee, this is what I’d use…

    <div class="bio-image">
      <?php
        $attachment_id = get_field('bio_image');
        $size = "people-img"; // (thumbnail, medium, large, full or custom size)
        $image = wp_get_attachment_image_src( $attachment_id, $size );
        // url = $image[0];
        // width = $image[1];
        // height = $image[2];
      ?>
      <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark">
        <img class="people-image" alt="Image of <?php the_title(); ?>" src="<?php echo $image[0]; ?>" />
      </a>
    </div>

    In the above code I’m using my custom “people-img” image size that we defined in the functions.php file.

    Unfortunately, if this doesn’t help we’ll need to see a screen cap of your current fields rules as well as the exact code you’re trying to implement.

  • If this is the exact code you are using you’re missing your opening <?php on line 8 and the closing ?> on the last line. You also need to set the $title and $url variables if you haven’t already.

    <p><?php the_field('vendor'); ?></p>
    <p><?php the_field('manufacturer'); ?></p>
    <p><?php the_field('component'); ?></p>
    <p><?php the_field('component_description'); ?></p>
    <p><?php the_field('model_or_part_number'); ?></p>
    <p><?php the_field('part_classification'); ?></p>
    <p><?php the_field('information'); ?></p>
    
    <?php
    $attachment_id = get_field('upload_document'); // Get and set the ID
    $url = wp_get_attachment_url( $attachment_id ); // Get document url from ID
    $title = get_the_title( $attachment_id ); // Get Title from ID
    if( get_field('upload_document') ): //If the document field is populated do... ?>
      <a href="<?php echo $url; ?>" >Download File "<?php echo $title; ?>"</a>
    <?php endif; ?>
    
    <?php
    $attachment_id = get_field('upload_document_2'); // Get and set the ID
    $url = wp_get_attachment_url( $attachment_id ); // Get document url from ID
    $title = get_the_title( $attachment_id ); // Get Title from ID
    if( get_field('upload_document_2') ): //If the document field is populated do... ?>
      <a href="<?php echo $url; ?>" >Download File "<?php echo $title; ?>"</a>
    <?php endif; ?>
    
    <?php
    $attachment_id = get_field('upload_document_3'); // Get and set the ID
    $url = wp_get_attachment_url( $attachment_id ); // Get document url from ID
    $title = get_the_title( $attachment_id ); // Get Title from ID
    if( get_field('upload_document_3') ): //If the document field is populated do... ?>
      <a href="<?php echo $url; ?>" >Download File "<?php echo $title; ?>"</a>
    <?php endif; ?>
    
    
  • Yes it is possible. Take a look here…

    http://www.advancedcustomfields.com/resources/getting-started/including-lite-mode-in-a-plugin-theme/

    I tried this approach myself, but as ACF and its plugins are in a constant state of development I find it easier to just maintain and update them separately from my themes. Just my two cents.

  • You want your image field to return “Image ID”. With the ID we can apply a custom size to the returned image.

    $attachment_id = get_field('field_name');
    $size = "full"; // (thumbnail, medium, large, full or custom size)
    $image = wp_get_attachment_image_src( $attachment_id, $size );
    // url = $image[0];
    // width = $image[1];
    // height = $image[2];
    ?>
    <img class="image-class" alt="" src="<?php echo $image[0]; ?>" />
    <?php

    More info about this in the documentation at http://www.advancedcustomfields.com/resources/field-types/image/

  • if get_field('upload_document'){ . '<p><a href="' . get_field('upload_document') . '" target="_blank" class="readmore">Download PDF → </a></p>' . };

    Yes it is possible to use the title from the uploaded document, but you’ll need to set the field to return the File ID instead of the File URL. With the ID you can retrieve the values like this…

    <?php
    $attachment_id = get_field('upload_document');
    $url = wp_get_attachment_url( $attachment_id );
    $title = get_the_title( $attachment_id );
    if( get_field('field_name') ):?>
      <a href="<?php echo $url; ?>" >Download File "<?php echo $title; ?>"</a>
    <?php endif; ?>
Viewing 16 posts - 1 through 16 (of 16 total)