How to finish a needle pagination?

The shooters
<button type="submit" class="prev"></button>
<button type="submit" class="next"></button>


Handler
var btn_load_post = $('.prev'),
 url_controller = "/wp-content/themes/sharkz_theme/custom_types/functions-portfolio.php";

$(function(){


btn_load_post.on('click',function(e){
e.preventDefault();
$.ajax({
 type : "POST",
 data : {action_page : "prev"},
 url : url_controller,
 success : function(data){

alert('oressed');


 } 
});
});
});


The PHP handler
if (isset($_POST['action_page'])){
 $paged = $_POST['action_page'];
var_dump($paged);
}


Var dump gives nothing, an idea that would be when you press the button, set off an ajax request, and depending on the query, prev or next, php needs to execute $I - /$I++

Guys who knows help with solution pliz, do not pass, + karma guaranteed!
July 8th 19 at 16:05
0 answer

Find more questions by tags WordPress