Retrieving all data from repeater fields

Please use below code to get list item <?php // check if the repeater field has rows of data if( have_rows(‘what_we_do_textarea_two’) ): // loop through the rows of data while ( have_rows(‘what_we_do_textarea_two’) ) : the_row(); // display a sub field value the_sub_field(‘list_item’); endwhile; else : // no rows found endif; ?>

Get used terms by an author as array of strings

I don’t know which line that error refers to but this code works correctly if everything falls into place exactly right. But there are actually several ways this could go wrong. For example, if get_query_var(‘author_name’) is not set you get an error on this line: $used_terms=list_author_used_terms($user->ID); If a problem occurs here: $terms = wp_get_object_terms( $p->ID, … Read more

Duplicate domain database to local – How?

I will suggest WordPress Duplicator, It is best tool for copying your site to any other host/localhost, and its free, I have used it many times and it works every-time with different server settings. Please note that I haven’t affiliated with it in any way.

Passing a shortcode attribute to a sub-function

There are different ways to get the result. You can use a class, store the div content in a class or instance variable and output it when needed. As alternative you can use a function with a static variable, to hold the content. I’ll use this second alternative, converting it in a class is an … Read more

file_exists() acting weird

You are using get_template_directory_uri(), that’s URL, not PATH. Instead use get_template_directory(), that’ll return PATH. Like: $csv = get_template_directory() . ‘/report/report.csv’;

Using Echo in ShortCode – Stuck

You can also use output buffering to catch all output you generate. Use it like following: function fl_aries_co_today_shortcode() { global $wpdb; $results = $wpdb->get_results(“SELECT horoscope FROM wpaa_scope_co WHERE date = CURDATE() AND sign = ‘aries'”); ob_start(); foreach($results as $r) { echo “”.$r->horoscope.””; } $content = ob_get_contents(); ob_end_clean(); return $content; } add_shortcode( ‘fl_aries_co_today’,’fl_aries_co_today_shortcode’ );

Add footer.php to WordPress child theme

You have wrong argument for the filter. The first argument of the add_filter is the filter you are hooking up to. In your case it’s the mesmerize_get_footer_copyright. The second argument is the Call back function that would run the filter is called. So change your add_filter to this add_filter(‘mesmerize_get_footer_copyright’, ‘change_copyrightText’, 10,1) ;