php - Wordpress how can I know if the pagination is active? -


Does Wordpress have a function or something like this? I need to check whether there is a page link (old entries | new entries) to display or not.

Best Regards,

If you look at the function, you get a $ max_page And $ paged vars will appear.

If the $ page is greater than 1, then the previous page is linked.
This is smaller than $ max_page, there is a front page link.

Then you can do the following functions:

  # If there is a next page function, it will be returned () {global $ paged, $ Max_page; $ Paged return & lt; $ MAX_PAGE; } # If there is an old page function, then it will return back__page () {global $ paged; $ Paged & gt; Return 1; } # If there is more than one page (before or after) then it will come true. The function has_pagination () is {return has_next_page ()) or has_previous_page (); }  

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -