Tag Info

New answers tagged

0

Are you using a checkbox or similar for the 'acf_platform' field using ACF for more than one selection? Advanced Custom Fields stores these as a serialised array, so a meta_query with 'compare' => '=' may not work. The ACF documentation suggests using 'compare' => 'LIKE' $args = array( 'meta_query' => array( array( 'key' => ...


0

In the posted code the variable $item is still being used but undefined now - also within the relationship query you can use standard WP calls like the_permalink() and the_title() without needing to echo.


0

Your problem is that you are putting the page result in $page. While the normal commands like the_title() and get_field() will look for the $post variable if you are not setting a seperate ID of which you want the title. I once did this by creating a backup of the $post variable, and then just put each post i wanted to include on the parent page in the ...


1

Small fix for you :) <?php if( in_array( "Yes", get_field( 'news__item--external' ) ) ) { ?> <a href="<?php echo the_field('news__item--external-url'); ?>" class="more icon--chev">View full article</a> <? } else { ?> <a href="home.php">Home</a> <?php } ?> The code to fix was: <php } else { ...


2

If the line breaks exist in the database, you just need to run your custom field output through wpautop(). Changes double line-breaks in the text into HTML paragraphs (<p>...</p>). If that doesn't work, then the line breaks probably are getting stripped before going into the database. In that case you'll need to share the code that saves ...


0

Many ACF fields give you an option of what sort of data you want returned from the field. The default for the taxonomy field is Term ID, while the example code you have is for field set to return Term Object. You can change this setting under the field group in the Custom Fields admin menu page.


0

if I recall correctly, get_field() simply returns the value of the field, not the actual term object. try using this with get_term() (or get_term_by() depending on your needs/preference).


0

I got it working - yay! :) It works with or without the test that Milo suggested to remove, but I left it out since it's not necessary. It is, however, necessary to have the $value in the function brackets. To use this you must use your own ACF field Id's of course. // generate post title on submit function auto_title_insert( $value ) { $value = ...



Top 50 recent answers are included