AJAX pagination, update current page

When you refresh the page, there is currently no state you can use to know you’re on page 2. You could use the History API to update the page URL without refreshing the page: history.pushState(data, title, ‘https://yourpage.com/?page=2’); You can also set some state on the user browser using the SessionStorage instead of the LocalStorage API, … Read more

Send an email to specific adress when button is clicked?

You need to call a JavaScript function when the button is clicked. It should be stored directly in the .php template and it should look like this: function SubmitData() { var email = <?php echo get_the_author_meta(’email’); ?>; $.post(“submit.php”, { email: email } } Then you need to create a PHP script, it could be stored … Read more

Adding number to date not working [closed]

your code is not working, because you use strtotime incorrectly… It should be used like this: int strtotime ( string $time [, int $now ] ) But you pass formatted dated as first param, and another string as second one. So how should it look like? Like so: $addeddays = intval( get_user_meta($this->order->user_id, ‘xxx’, true) ); … Read more

How to get next image with this code from same post?

I’m afraid that your code doesn’t make much sense (especially the part with foreach loop…), but here’s how it can look like… $attachments = get_children( array( ‘numberposts’ => -1, ‘order’ => ‘ASC’, ‘post_mime_type’ => ‘image’, ‘post_parent’ => $posid, ‘post_type’ => ‘attachment’, ) ); // print image 0 if ( array_key_exists( 0, $attachments ) ) { … Read more