php - WordPress - Add Numeric Pagination. -
I am using numeric post navigation code in my WordPress theme. I have set the Blog Page Show to a maximum of 24 pages so that page navigation displays 8 pages. Ex: My code is, in the front page Page Navigation I think you might have some encoding problems because I think that instead of using it, 3 points When the encoding is incorrect and the browser can not find a specific character in its character table, it will default to a question mark Will display as. There are several possible solutions: Change the character for simple points in your code where this is the comment: <<> Try setting your page to UTF-8: your Instead of displaying that particular, use the html special character code to display the character that is called the horizontal ellipse and it should be displayed like this: You can use the first solution, or any of the previous 2 solutions / I have given you to fix your problem Note : I just remembered that the encoding problem can come from the PHP itself, so in case of your script it is: 1 2 3 ... 8 . But does page navigation actually show me
1 2 3? 8 . Now my question is, what is the error in the code given below
instead of its dot? is showing, please help me anybody.
function wpbeginner_numeric_posts_nav () {if (is_singular ()) return; Global $ wp_query; / ** If only 1 page * / if ($ wp_query-> max_num_pages & lt; = 1) stop execution on return; $ Paged = get_query_var ('paged')? Absint (get_query_var ('paged')): 1; $ Max = interval ($ wp_query-> max_num_pages); / ** Add existing page to the array * / if ($ paged & gt; = 1) $ links [] = $ paged; / ** Add pages to the array around the current page * / if ($ paged & gt; = 3) {$ links [] = $ paged - 1; $ Link [] = $ page - 2; } If (($ paged + 2) & lt; = $ max) {$ links [] = $ paged + 2; $ Link [] = $ page + 1; } Echo & lt; Div class = "navigation" & gt; & Lt; Ul & gt; '. "\ N"; / ** Previous Post Link * / if (get_previous_posts_link ()) printf ('
& lt; php wpbeginner_numeric_posts_nav ();? & Gt;
... You are using a special character called "horizontal ellipsis" ->
... which combines 3 points in the same letter (try to select both points and you can see the difference First example is 3 characters, and second, 1 single char).
/ ** From the final page Link, plus alpiece if necessary * / <
& lt; Li & gt; of
& lt; meta http-equiv = "content-type" content = "text / html; charset = UTF-8" & gt;
& lt; Head & gt; .
& Hellip;
mb_internal_encoding (" UTF-8 "); Source:
Comments
Post a Comment