I want to send an email when each post is published

Try logging out of the site and going to /wp-admin (to get to the login screen). Click on the Forgot Password link and enter your username. Did you get an email with password reset instructions? If not, that means that the email configuration (as Emetrop has suggested) may not be correct for the server.

get_posts that match a user-specified value on a page

Using a variable will make your code a little less repetitive: $case_history_code = get_field( ‘case-history-code’ ); if ( $case_history_code ) { // make the code lowercase $case_history_code_lower = strtolower( $case_history_code ); // use the lowercase inside of `get_posts` $myposts = get_posts( ‘numberposts=3&offset=0&category_name=” . $case_history_code_lower ); foreach ($myposts as $post) : setup_postdata($post); ?> <a href=”https://wordpress.stackexchange.com/questions/220489/<?php the_permalink(); … Read more

How can I show custom fields in the loop only to specific user roles?

You can use current_user_can() and is_user_logged_in() to validate current user: <?php if ( is_user_logged_in() && current_user_can(‘role’) ) : ?> <span style=”font-size:16px”> <strong>Currently reading:</strong> <?php the_field(‘book_name’); ?> (<?php the_field(‘book_year’); ?>)<br/> <strong>Currently seeing:</strong> <?php the_field(‘movie_name’); ?>”><br/> </span> <?php endif; ?> Make sure to change role to your preference and take a look at Codex for more info.

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