Load more posts in the same category – Ajax + Timber

I think there is a small correction in your code, you just passing page number but you have pass category ID also. I’ve added data-category attribute in load more button. So your archive.twig should like: <section class=”archive”> <p class=”archive__title h-headline text-size-l”>In the same thematic</p> <div id=”archive__list” class=”archive__list”> <article class=”post”> … </article> </div> </section> {% if … Read more

Send a mail to specific address in a custom field when a new comment is made on a specific post

It sounds like it’s not working because you’re hooking into comment_post, which is when the comment is created If you change the status of the comment, the comment already exists, and therefore no email is generated. There is a comment status change hook: comment_{$old_status}_to_{$new_status}. It fires anytime a comment’s status changes from one specified status … Read more

how to enqueue javascript to manipulate acf input field in admin?

Maybe an easier approach would be to remove the values before the input is presented in the admin? That would circumvent having to do things in JavaScript after the field is already displayed. Take a look at acf/prepare_field hook: function my_acf_prepare_field( $field ) { unset($field[‘choices’][‘custom’]); return $field; } // Apply to all fields. // add_filter(‘acf/prepare_field’, … Read more

Add User Role: Pre-saved in User-Meta [SOLVED]

That’s because you’re not passing an actual ID to get_user_meta, but merely a string of id: $get_portal_number = get_user_meta(‘id’, ‘portal_number’, false); In addition, the third parameter is set to false, which will return an array. You’re passing that value straight to $user->add_role, but that expects a string. You either have to loop over your post … Read more