Appending an ACF custom field to the page title

If you need to append something to EVERY post_title you have, you should: Make your loop with WP Query, check Codex Then, use get_the_ID, to get the specific post ID, check Codex Then, use the ID to get the ACF field from that specific post like get_field(‘name-of-the-field), check the documentation Don’t forget to use wp_reset_query(), … Read more

Send a custom notification to customer on WooCommerce cancelled order status

A better solution will be to use all arguments included in woocommerce_order_status_cancelled hooked function, so the missing $order variable. Also as the action hook woocommerce_order_status_cancelled is triggered when order status change to “cancelled”, so in your code, if ($order->has_status(‘cancelled’)) { is not needed. Then your code will be: add_filter(‘woocommerce_order_status_cancelled’, ‘woocommerce_send_mail_abandonned_order’, 10, 2 ); function woocommerce_send_mail_abandonned_order( … Read more

Adding multiple conditional tags in a function?

You want to put those category IDs into an array really, the IF can only handle one condition at a time, so you could change your if statement to be: if( is_category(’16’) || is_category(’12’) ) { In PHP, the || stands for OR, whilst && stands for AND, so your if statement is saying if … Read more

Inserting a shortcode into a genesis menu?

The problem is the fact that you are trying to echo something into a string, echo should only be used to output something, so simply change the following line: $items .= ‘<li class=”myclass”>’ . echo do_shortcode(‘[shopping_cart]’) . ‘</li>’; To this: $items .= ‘<li class=”myclass”>’ . do_shortcode(‘[shopping_cart]’) . ‘</li>’; Edit: On another note, this is merely … Read more

Sort author list alphabetically

Your Query gets the authors ID and is you want them sorted Alphabetically you will need to get the author(user object) so try: $authors = $wpdb->get_results(‘SELECT DISTINCT post_author FROM ‘.$wpdb->posts); if($authors){ $users = get_users( array( ‘include’ => $authors, ‘orderby’ => ‘display_name’ )); foreach ((array)$users as $user) { echo ‘<li>’ . $user->display_name. ‘</li>’; } }

Predefine Magazine Style Layouts

You can use a couple known plugins. TYPES and VIEWS, by wp-types.com. Please keep in mind that I am in no way, shape, or form affiliated with these plugins or plugin authors. Also, please note, the TYPES plugin is free, and the VIEWS plugin is premium. You will not be able to receive support for … Read more

Null value given when confirming email’s

Firstly, this isn’t an error, it’s a warning. If it’s causing a page crash rather than a logic bug, thats because you’re printing your error log to the screen, not logging it to a log file as you should be doing. Turning off display errors should fix this. This still leaves you with the warning, … Read more