Save input form on custom field
Save input form on custom field
Save input form on custom field
Your question is not very clear, but as I understand you want to place ACF field on your pages. You can edit custom field in Custom Fields, choose desired field group and custom field and simply edit it. If you want to create new field and place it on your page just use this in … Read more
From what I understand, you are trying to update an ACF field on a new post. From my experience, it is preferable to use the field key instead of the field name in the ACF functions – using the field name gets you in all sorts of strange situations – like the one you are … Read more
To log a user in you really only need the user’s ID. Based on your info you should be able to obtain it from the username field. // Get User object $user = get_user_by( ‘login’, $username ); // Clear any auth cookies wp_clear_auth_cookie(); // Log the user in wp_set_current_user( $user->ID ); wp_set_auth_cookie( $user->ID ); On … Read more
There is a PHP function: preg_grep which accepts $pattern and $input as a parameters and returns you an array of matches. If you want to get first match just assign it to variable, e.x.: $field_os = array(‘windows-7′,’mac-os-10.07′,’linux-ubunto-16.04’); $user_os_type = “windows”; $matches = preg_grep(“https://wordpress.stackexchange.com/” . $user_os_type . “https://wordpress.stackexchange.com/”, $field_os); var_dump($matches); /* Prints: array(1) { [0]=> string(9) … Read more
Sub Field of File Field
Replace the code for the featured image in template file with custom field image from Advanced Custom Field of the woocommerce product catalogue.
Concatenate the shortcode with the field value just before you evaluate it with do_shortcode. the_field(‘link’) will automatically output the value while get_field(‘link’) will return the value. <?php echo do_shortcode(‘[sociallocker]’. get_field(‘link’) . ‘[/sociallocker]’);?> The problem you had before is that your evaluating the first 1/3 which doesn’t include the data. Then you print the data. And … Read more
You’re testing if assigning a value to $mylink was successful in the if statement rather than testing if it’s empty. Try something like: <?php $article_link = get_field(‘article_link’); if( $article_link[‘url’] ): ?> <a href=”https://wordpress.stackexchange.com/questions/246505/<?php echo $article_link[“url’]; ?>”><?php echo $article_link[‘title’]; ?></a> <?php endif; ?> See Example 1 in the ACF docs.
You just need to echo get_post_permalink() <?php echo get_post_permalink();?>