Advertisement
fauzanjeg

Change Post Per Page for Specific Page || 404 page

Nov 23rd, 2021
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. /* Change Post Per Page for Specific Page || 404 page */
  2. function change_attr_404_page( $attr, $name, $id ) {
  3.     if( 'jnews_404_' === $name ) {
  4.         $post_per_page = 5; /* Show post per page */
  5.         $attr['pagination_number_post'] = $post_per_page;
  6.         $attr['number_post'] = $post_per_page;
  7.     }
  8.  
  9.     return $attr;
  10. }
  11. add_filter( 'jnews_get_content_attr', 'change_attr_404_page', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement