ACF – Query relationship without ID
If only 1 value in relation field : $city_id = $bnb_ville[0]->ID; if it could be more than 1 value : $city_id = []; foreach ($var as $post) { $city_id[] = $post->ID; } $bnb_ville is the variable for get_field() !
If only 1 value in relation field : $city_id = $bnb_ville[0]->ID; if it could be more than 1 value : $city_id = []; foreach ($var as $post) { $city_id[] = $post->ID; } $bnb_ville is the variable for get_field() !
http://voodoopress.com/2011/03/adding-meta-boxes-to-your-post-screen/ Is a post I wrote the other day about adding meta boxes. I use it to put links in to change the link some of my post titles use. I’m not sure if this is what you are looking for exactly, as I’m not quite sure what you mean by ‘extra fields’
You could create a custom meta box that has a checkbox for whether or not to show in the slideshow. Post Thumbnails/Featured Images sound like what you’re looking for. Note that images uploaded/attached to a post in WordPress do not necessarily have to appear in the content.
It looks like you’re using a custom plugin. Is that the case? Anyway for the line: <?php echo get_post_meta($post->ID, ‘banner_image’, true); ?> Why aren’t you using something like: <img src=”https://wordpress.stackexchange.com/questions/21729/<?php bloginfo(“template_url’); ?>/images/<?php echo get_post_meta($post->ID, ‘banner_image’, true); ?>”/> Another way to debug is to echo the post ID to the screen and see if it is … Read more
Its the second time i find myself recommending this plugin today, ProjectManager is a plugin that will answer most of your requirements. here is a screencast of how to use it
You could use the plugin “Custom Field Template” to replace standard custom fields with a much easier to use interface, that also allows you to use checkboxes, selects, textareas with tinymce, and file uploads among others. Then the client would just upload the image through that field and you use <?php $bg = wp_get_attachment_image_src(get_post_meta($post->ID, ‘custom_field_name’, … Read more
Then you need a filter on the_content. function add_conditional_div($content) { global $post; $meta_field = get_post_meta($post->ID, ‘your-field-name’, true); if (1 === $meta_field) { $content .= ‘<div>whatever</div>’; } return $content; } The 1 value, of course, is whatever should match your meta_field. http://codex.wordpress.org/Function_Reference/get_post_meta http://codex.wordpress.org/Function_Reference/the_content You could also edit your theme files directly or make a child theme. … Read more
If two fields are named people[name], only the last value will be sent with the form. To be completely reliable, you’ll need to use an id for each person you’re collecting details on: <input name=”people[0][name]”> <input name=”people[0][email]”> <input name=”people[1][name]”> <input name=”people[1][email]”> … Use an incrementing counter in your while loop to do this ($i): <?php … Read more
If by “featured posts” you mean sticky post, those posts should come first. You have to jump through hoops to prevent that. There is likely a filter in your theme or a plugin that is altering that default behavior. Search the /wp-content/ directory for pre_get_posts. If “sticky posts” is not what you mean, you are … Read more
I believe you want is_user_logged_in if(is_singular(‘debate’) && is_user_logged_in()) { // … } (Note: is_singular is misspelled in your code.)