Tag Info

New answers tagged

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 = ...


0

Final code which worked for me: <?php if ('english' == get_field('english_or_deustch')) { ?> <div id="footer-menu"> <?php wp_nav_menu( array( 'menu' => 'Footer - English' ) ); ?> </div> <?php } else { ?> <div id="footer-menu"> <?php wp_nav_menu( array( 'menu' => 'Footer - Deutsch' ) ...


0

You check if !$value before assigning the title from the fields, that test will be false once the post has a title. If you always want it to update, then remove the test. function auto_title_insert() { return $_POST['fields']['field_538626f57e84c'].' '.$_POST['fields']['field_538627ffeccb0'].' '.$_POST['fields']['field_53863a5c7502b'].' ...


0

I think that if you make your choices list a value=>label list, this should work: http://wordpress.stackexchange.com/a/11454/20807 Instead of your current list, 1 : Ultimate Plus 2 : Ultimate 3 : Professional 4 : Commercial 5 : Business 6 : Free It can also be in the order that you currently have 6 : Free 5 : Business 4 : Commercial 3 : Professional 2 : ...


0

Assuming that you will have a loop to display the results of the query, you could loop through the repeater at that point and display only the row that has the correct value.


3

Just for information, this is a bug in WP and autop. You can view the ticket here and it does not look like it will be fixed any time soon. The work around is to start your multiline comment with <!-- and end it with <!-- -->


0

I have to do similar things all the time. You are already using ACF, which is what I use, actually I use ACF5 Pro version now, but the same thing can be achieved using ACF4 and the Options Page add on. What I do is create an options page for each post type and set the parent of is so it appears as part of the fly out for the post type. Then I create custom ...


0

use $_GET['Price'] and $_GET['Region'] to get the price and region values from the url and add them to your query args. It is rather hard without any code to start from, but try something like $queryPrice = (strpos($_GET['Price'],'-') ? explode('-', $_GET['Price']) : array($_GET['Price'], $_GET['Price'])); $queryRegion = $_GET['Region']; $args = array( ...


0

Well, I found out what it was. Actually I think this might be caused by a bug in Wordpress (or perhaps one of the add-ons I'm using). In the content editor I had blocked out some of the code with "". For some reasonthe closing markup "-->" didn't get registered, so in the code anything after the_content(); got blocked out.


0

Try this: <?php $acf = false; while ( have_posts() ) : the_post(); if( have_rows('boxes') ) $acf = true; the_content(); if( $acf == true ): echo '<p>This is only shown when the_content() is removed.</p>'; else : // no rows found endif; endwhile; ?> This is ...


0

In your have_rows() calls, you put the $post_id variable in a single-quoted string - which is wrong. It should be have_rows( 'right_column_box', $post_id ). // Edit Of course, this is also true for the get_sub_field() calls.


0

You need to ask for the child term image field. You have only asked for the current page's query object image, which may be blank depending on what the query object is. <?php $term_id = get_queried_object()->term_id; $taxonomy_name = get_query_var( 'taxonomy' ); $termchildren = get_term_children( $term_id, $taxonomy_name ); // Loop through ...


0

I wrote a plugin to do validation for Advanced Custom Fields. It lets you do server side validation using either PHP code or regex, jQuery masked inputs, as well as unique value settings. Check the Support page for the beta version that support ACF5. http://wordpress.org/extend/plugins/validated-field-for-acf/


0

As suggested in the comments by @Nilambar, wp_insert_post returns the ID of the post it created. So: $new_patient = wp_insert_post( array( 'post_name' => $p_name, 'post_title' => $p_name, 'post_type' => 'patient' ), true ); Then used the returned ID to create your relationships, add your meta and terms, ...



Top 50 recent answers are included