How to customize a divs background dynamically using Advanced Custom Fields Plugin?

You can apply a style to the header <div> (or the <header> element), and then add an inline style using wp_add_inline_style(). For example, let’s say you’ve got something like this in your header.php file: <header id=”masthead” class=”site-header” role=”banner”> (Cribbed from the Twenty Twelve theme.) Let’s say you’ve set up the neighborhood’s color as post meta-information … Read more

ACF get field label in custom code

Try this, which worked for me: <?php $fields = get_field_objects(); // I changed from get_fields() if( $fields ): ?> <ul> <?php // I changed $value to $field (i.e. the variable name) foreach( $fields as $name => $field ): if (stripos($name, ‘isbn’) !== false) : ?> <li><b><?php echo $field[‘label’]; ?></b> <?php echo $field[‘value’]; ?></li> <?php endif; … Read more

Query pages for use of a flexible content layout

I posted this on the ACF support forum as well and got great feedback: https://support.advancedcustomfields.com/forums/topic/query-pages-for-use-of-a-flexible-content-layout/ With a bit of tweaking, it worked. Here’s what I ended up with: <?php $flex_content_name=”flexible_content”; // < update with applicable field name $layout_name=”featured-resources”; // < update with applicable subfield name $args = array( ‘posts_per_page’ => -1, ‘post_type’ => ‘page’, ‘meta_query’ … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)