Support

Account

Home Forums Search Search Results for 'field not displaying'

Search Results for 'field not displaying'

reply

  • Hey guys.

    Last night I pushed a fix to github. Please download and report back if the problem is fixed.

    Cheers
    E

  • Awesome. Thanks a bunch.

  • I had the same issue: ttp://support.advancedcustomfields.com/forums/topic/relationship-field-not-displaying-data/

    A fix is in the works.

  • Thanks Elliot. I’m really impressed by ACF. Keep up the great work!

  • Hi guys.

    I’m 99% sure that the issue is due to ACF not loading the selected values based on an issue with the post_type parameter to the WP_Query function

    Your data will only be lost if you update a page which had selections on it. I will fix a fix for this today.

    Thanks
    E

  • @ciceron Hah, I did the same thing trying to fix it 🙂

  • Confirmed that 4.2.0 works. Just tried that, and it works fine. So I took a look at the changelog, and it says “Relationship Field: Add new option for return_format”. So I played around with that option on the admin screen, thinking that maybe I just needed to re-save the field type. No joy.

  • I have this same issue on a client site. Completely broke a feature I built for them months ago that relied on the relationship field returning a post object.

    Just rolled back to 4.2.0 and everything works fine again.

  • I just found this post on the forum (I searched before already 😉 ):
    http://support.advancedcustomfields.com/forums/topic/displaying-items-within-a-cpt-as-choices-in-repeater-for-another/

    It might be related to my problem. Do I understand correctly my only solution is to maybe use the ‘Dynamically populate a select field’s choices’ solution? 🙁

  • @PerS & @Mathias Gomig – after a considerable amount of searching, I finally figured out that this problem is being caused by the ‘load_field_defaults’ function in ACF’s core/fields/_base.php. The value is being saved and even being loaded without issue, but this function overwrites the value of the field with the default value. I’m not entirely sure why this is happening, but it’s definitely the culprit.

    To resolve the situation, simply override this function like so:

    function load_field_defaults( $field ) { return $field; }

    The field values are now displaying correctly for me on ACF 4.2.0.

  • Hi @darkwoods

    Have you read over this guide:
    http://www.advancedcustomfields.com/resources/how-to/how-to-get-values-from-a-taxonomy-term/

    This will explain how to load from a taxonomy term.

    If this is not the correct answer, please re-explain your issue as it is very confusingly written in a repeating format that is hard for me to read and also understand when I read it

    Thanks
    E

  • Hi @Patrik

    That’s more of a question for google and the WP codex.

    Cheers
    E

  • This worked great. I finally have a sidebar again after some 4 hours of ripping my hair (not really – i don’t have hair). So thanks!

    While I’m at it though – is there a way of doing this more automatically? Can WP find the ID of the posts page instead of me setting it explicitly like this?

  • Ok so there you are using is_home() to find the homepage, but is there a similar function to find the posts archive page?

    Thx.

    Edit: Oh wait, my bad. Confused it with is_front_page() 🙂

  • Hi @Patrik

    When you select a page to act as the ‘Blogs’ archive page, the global $post object does not point to the page called Blog, instead it points to the loop of posts.

    This means that ACF will load the data (via get_field) from the wrong place (not page called Blog).

    To get around this, you will need to specify the Blog page ID in the get_field function.

    something like:

    
    <?php
    
    $post_id = false;
    
    if( is_home() )
    {
    	$post_id = 123; // specif ID of home page
    }
    
    $use_sidebar = get_field('use_sidebar', $post_id);
    $choose_sidebar = get_field('choose_sidebar', $post_id);
    dynamic_sidebar($choose_sidebar);
    ?>
    
  • Hi @JFK

    It is possible that one of the followin is causing the issue:
    * Your ACF functions are place outside the posts loop – All code relevant to the post should be within the loop
    * Double check that award_logos is the correct field name for the repeater field

    You can also debug the repeater field value like so:

    
    <?php 
    
    echo '<pre>';
    	print_r( get_field('award_logos') );
    echo '</pre>';
    die;
    
     ?>
    
  • Great thanks for the heads up on the image, however I am still not seeing the repeater fields output, the has_sub_field(‘top_links’) is not returning and values, or at least that is what I am think, because the while loop is not doing anything

  • I have tried using both but I am still not seeing any output

  • @wdoutjah What is your code for displaying the repeated fields?

  • Hi @elliot

    Yes, I can see that you have selected a post object (which is titles the same as the category it is in.)

    I am now more confused as you have multiple relationship fields…

    Can you please start this question again with clarity. And please state what is NOT working, and what IS working.

    This is a guess, but on each page, you have ‘right’ and ‘left’ modeuls. In your right 1 module, you want to load in the category which is assigned to the post object of the same name?

    Are you using a promo box as a dummy holder for the taxonomy? Or are you loading any extra data from the promo box? Why are your promoboxes called the same as your category?

  • Would you be able to assist if we we’re to purchase the WYSIWYG and Gallery add-ons? Need to find a way one way or another to be able to get the custom fields on other page.

  • Thanks E, I really appreciate your help with this.

    • You have a CPT called ‘Promo Boxes’ – Yes
    • ‘Promo Boxes’ suports the ‘category’ taxonomy – Yes
    • Promo Boxes has some custom fields. What are they? Are they relevant to this issue? – I’m not sure if they’re relevant, but just in case: Content (Wysiwyg Editor), Image (image), Link (text), Alternative title (text), Latest News or Reports? (Radio button)
    • You are tyring to load the category ID. Where from. – I’m not exactly sure how to answer this question, but the user may choose a category for a Promo Box, I’d like this category to be loaded, if Latest News or Reports? == Yes
    • What URL are you looking at? – http://burma.23.co.uk/campaigns/crisis-in-arkan-state/ – specifically the first box in the right column (News). Happy to give you admin access if that helps
    • What template file is running – I’m using the Roots theme and it’s base.php template, alongside four other custom templates: section.php (in the root folder, necessary for Roots, primarily used to import the three subsequent templates); left-section.php (the left sidebar); content-section.php (the centre column), right-section.php (the right sidebar).

    Does that give you what you need?

  • Hi Elliot,

    1. You are setting the variable $post_objects twice. Why?
    Most probably because I don’t know what I’m doing :). I’ve removed the extraneous one on my code now.

    2. I can’t see in your code where you are loading the category for.
    I think this is my problem, I’m not sure how to load the category. What I’ve done is:

    1. Created a custom field type (Promo Boxes) – which includes the categories built-in taxonomy
    2. Created custom fields and tied them to the Promo Boxes CPT
    3. Created a post in Promo Boxes and assigned it to a category
    4. Tried to grab the category ID from this particular post

    Does that make sense?

    There is no custom field containing the category name, should there be?

  • Hi @emmaee

    Can you try loading the gallery data at a WP level. As in, can you use the get_post_meta function (documentation on WP.org)?

    Does that work?

    Maybe there is a bug with the get_field function….

  • Hi @Debatewise

    2 mian issues.

    1. You are setting the variable $post_objects twice. Why?

    2. I can’t see in your code where you are loading the category for.

    The issue is this part right?

    
    <!-- If the promo box is showing latest news or reports -->    
              <?php if(get_field('latest_news_or_reports', $post_object->ID) == "news"): ?>
                <?php query_posts( array ('posts_per_page' => 5, 'order'=> 'DESC', 'orderby' => 'date', 'category__in' => '' ) ); ?> 
                <?php if(have_posts()) : while(have_posts()) : the_post(); ?>   
                  <li class="title"><a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a></li>     		
                  <?php endwhile; ?>
                <?php endif; wp_reset_query(); ?>          
              <?php endif; ?><!-- News/Reports promoBox ENDS -->
    

    If not, please correct me.

    You have set

    
    'category__in' => ''
    

    Which I’m guessing you want to populate with a custom field value?

    What is the name of the custom field that contains the category name?

Viewing 25 results - 451 through 475 (of 508 total)