Handling repeater data

Try: $fields = get_field(“updates_list”). And then print_r to see what’s inside. You should have a nice looking array with all repeater fields and values inside. Then, stop using have_rows and get_row and just loop using a foreach loop. get_field() is usually used to retrieve a unique field, but because it’s a repeater field you get … Read more

Illegal string offset error in wordpress theme options textarea

If get_option( ‘blogkori_theme_options’ ) doesn’t have a value you’re not going to get an array back, which means that $options[‘googanalytics’] isn’t valid. You’ll need to account for this possibility. You could do that by checking if googleanalytics is set, and setting it to a new variable, or an empty string if it’s not set: $options … Read more

How insert a DIV at top of current theme? [closed]

As I can see in wp-primer-theme sources: there are do_action( ‘primer_body’ ); on the top of content and do_action( ‘primer_before_header’ ); just below. You can update your child theme functions.php with your own action add_action(‘primer_before_header’, function() { echo ‘<div class=”logo”></div>’; });

How to get a list of users who like a current wordpress post [closed]

According to the code samples in the article _user_liked post meta should hold all the user ids of those who liked it. Something like this should be able to solve it for you <?php $post_id = get_the_ID(); $users_liked = get_post_meta( $post_id, ‘_user_liked’, true ); if ( ” !== $users_liked && ! empty( $users_liked ) ) … Read more