I have a function which named kriesi_pagination, which is a function for showing page numbers in php. I copied the code into the functions.php for my site.

The I call this function in the index.php file for showing the page numbers on the index page of my site. I use this code like this inside index.php: <?php kriesi_pagination(); ?>

What should I do if I want to show the page numbers in other places such as on category pages? It just shows the page numbers in home page of site not any other places.

I want to have page numbers for the categories like sports, musics, technology, etc.

  • Hi aliboy38. From reading through your previous questions, I'd recommend that you spend some minutes in the FAQ page and read about how this site works. You can comment on old questions, mark answers as solution, improve your questions, etc. Please also always leave links to sources in your question, so people see where you actually got the code and can read the why_s and _how_s. Hint: It's not necessary to tell that you are using WordPress. At least, this Q/A site _is only about WP. :) – kaiser Sep 22 '12 at 13:48

You're asking "how to use template tags". Actually there's a Template Tags page in the Codex.

Template tags are used within your blog's Templates to display information dynamically or otherwise customize your blog, providing the tools to make it as individual and interesting as you are

- Source: Codex entry about Template Tags

As you've already done, you can write custom Template Tags (basically just php functions) - aside from those provided by core, like wp_head() or the_content().

When you want to have specific functions on specific pages, simply open up your theme folder, choose the right template that fits to this specific request and add your Template Tag. To see what template is used when, just take a look at the Template Hierarchy diagram in Codex.

  • Thanks. I know that. I wanna choose category template but I couldn't find that – ALI VOJDANIANARDAKANI Sep 22 '12 at 13:58
  • Look at the template hierarchy diagram. You can see all fallbacks there. – kaiser Sep 22 '12 at 13:59
  • Thanks. I call the function in content.php but it's gonna show page numbers under last post. but in the main page in index it's gonna show upper the footer. It's better to show that at the top of the footer. How can I do that? – ALI VOJDANIANARDAKANI Sep 22 '12 at 14:06
  • Either place it inside footer.php or move it around in your other template files until it is where you want it. There's no chance that I can tell from here. – kaiser Sep 22 '12 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.