List of posts by day of the week

What about using just get_posts (removing the order_by argument), then looping through to create and array of programs, then building the output from that: $posts = get_posts(array(‘post_type’=>’programas’,’meta_key’=>’audio_date’)); $programs = array(); foreach ($posts as $post) { $days = get_post_meta( $post->ID, ‘audio_date’, true ); // $time = get_post_meta( $post->ID, ‘audio_time’, true); $found = false; foreach ($days as … Read more

Outputting an array of term meta values in a custom WooCommerce tab?

For your author content display, instead of print_r($all_term_meta); try a foreach: foreach($all_term_meta as $meta) { return $meta[0]; } It’s possible you may need to use “echo” instead of “return” but try “return” first. To control whether or not there is an author tab, update your woo_new_product_tab function with the same condition: function woo_new_product_tab( $tabs ) … Read more

How to check an array of $curauth fields?

Try <?php if ( !empty( array ( $curauth->facebook ) ) || !empty ( array ( $curauth->linkedin ) ) || !empty( array( $curauth->twitter ) ) ) { echo ‘echo me if any $curauth info exists’; } ?> Note: This can be all on fewer lines, I’ve just put in additional line-breaks to make it all fit … Read more

How to use shortcode attribute in separate function

To be able to use a variable that is essentially being created within the shortcode function, you’ll need to store it somewhere and then retrieve the value. WordPress does use global variables internally to store and carry across values, but I wouldn’t advise you do the same though. Read about the options API here. Pretty … Read more

How to validate register settings array

Personally I’d do it the same way, since it seems to be the only point where you can examine user input and validate it. Also, heavily borrowing from code sample in this excellent article: function wpPartValidate_settings( $input ) { if ( check_admin_referer( ‘wpPart_nonce_field’, ‘wpPart_nonce_verify_adm’ ) ) { // Create our array for storing the validated … Read more

Dropdown category filter

I don’t see where your posts are pulling from, just the category list, but you are most likely missing the post_count variable where you have your query args to retrieve the posts. post_count=-1 will return all, but it defaults to 10 (or whatever is set in your settings) if you do not specifically say otherwise.

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