Smaller Size for featured images
Smaller Size for featured images
Smaller Size for featured images
There is no current way you can achieve this as per 4.6.1 by using wordpress by default. You would need to modify the way wordpress core works or recreate a custom media uploader for wordpress.
If your ACF “_tl” is located on Options page, you don’t have to use the code provided in a link ( ob_start(); , $content = ob_get_contents(); ob_end_clean();). You just need to specify the page that contains this field in have_rows function, in your case – it is Option page. So: if( have_rows(‘_tl’,’option’) ): … while( … Read more
The after_setup_theme hook is actually an action hook not a filter hook. Nonetheless that should not be needed. Give this a try: if( ! function_exists( ‘get_field’ ) ) { function get_field( $key, $post_id = false, $format_value = true ) { if( false === $post_id ) { global $post; $post_id = $post->ID; } return get_post_meta( $post_id, … Read more
It looks like you’re mixing two types of if/else statements <?php } elseif(get_field(‘wide_box’)): { ?> should be <?php } else if ( get_field(‘wide_box’) ) { ?> and <?php } endif; ?> should just be <?php } ?>
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
WordPress dynamic subpage for ACF
I added this code before my loop and separated the custom taxonomy templates rather than pointing them to one general search template to display results based on the current taxonomy. Hope this helps someone. $current_cat = get_query_var(‘model’); $args = array( ‘post_type’ => ‘truck’, ‘model’ => $current_cat ); query_posts($args);
It’s probably best to loop through your posts two times. Once to group them by year and once to print the posts. Something like this: (not tested) $formatted_posts = array(); while ( $subsQuery->have_posts() ) : $subsQuery->the_post(); $year = get_field(‘year’); // add them to formatted_posts array and group by year $formatted_posts[$year][] = $post; endwhile; foreach($formatted_posts as … Read more
This is quite possible. You want to pass into the form the user’s id and make them author of the custom post you create programmatically when they submit the form. Each user will have one post of that type. By default, when a user goes to that page, it will load a form with data … Read more