Unable to edit Navigation bar

The first step is to make the “Shopping Nav” Active. It’s currently set to “display:none” in the css, probably because the menu isn’t active. Once you change display:none on that menu, then you can start positioning it to be split from the other menu at the top of the screen. This is what needs to … Read more

query_posts problem – need help

You’ll have to get the terms of current post with get_the_terms function and then use them in your query. // this will get terms and then get only term_ids from them $term_ids = wp_list_pluck( get_the_terms( get_the_ID(), ‘coupon_category’ ), ‘term_id’ ); $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $related = new WP_Query( array( ‘post_type’ => APP_POST_TYPE, … Read more

I want to display the content of a text field only if it has been entered

Do echo inside an if statement. function show_my_message() { $settings = get_option(‘wc_checkout_message_settings’); //Check if the array is set if( isset($settings[‘wc_checkout_message_text_field_0’]) && !empty($settings[‘wc_checkout_message_text_field_0’]) ){ echo $settings[‘wc_checkout_message_text_field_0’]; } //Check the other value and show it if(isset($settings[‘wc_checkout_message_text_field_1’]) && !empty($settings[‘wc_checkout_message_text_field_1’]) ){ echo $settings[‘wc_checkout_message_text_field_1’]; } }

Use custom field value as href

To retrieve a value after using add_settings_field() you should use get_option(). So you could do something like this… $value = esc_html(get_option(‘option_name’)); if ($value) { echo ‘<a href=”‘ . $value . ‘”>Click Here</a>’; } You just need to change option_name to your field name. The code will grab the value and if it isn’t false echo … Read more

How to access variables from one plugin in another

This is the answer to the main question. You cannot access other plugin’s variables. If they’re programmed using Object Oriented Programming pattern, then maybe you will be able to access a few public variables. But it is not the standard WordPress way. The best way to do it is by using actions and filters. If … Read more