WordPress.org

Ready to get started?Download WordPress

Forums

show page x of y for specific category (6 posts)

  1. macrocurio
    Member
    Posted 1 year ago #

    Howdy!

    At the bottom of each post that is in the category 'painting' I want to show 'Page X of Y'.
    Currently I have 2 posts in this category, so the first post would show Page 1 of 2.
    Showing Y is easy, but I'm not sure how to show X.

    Thanks!

  2. Santosh
    Member
    Posted 1 year ago #

    you need to edit your theme files for this

  3. macrocurio
    Member
    Posted 1 year ago #

    I know that the theme files will need to be edited, I want to find out what code is necessary for what I want :-)

  4. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    Sorry but all of our psychic browsers are offline at the moment. So rather than accessing your theme by the powers of divination, we need you to post a url to your site so we can see this theme in action. We are sorry for this inconvenience but we will try to restore Psychic Support as soon as possible ;-)

  5. keesiemeijer
    moderator
    Posted 1 year ago #

    Is this on a category template?
    http://codex.wordpress.org/Template_Hierarchy#Category_display

    Showing Y is easy ...

    How do you show Y?

  6. macrocurio
    Member
    Posted 1 year ago #

    Esmi - the page that I'm trying to do this on is http://shireenmussa.com.au/painting/test as you can see my current attempt shows 'Page 4 of 2' - the first number includes all the published posts which I don't want.

    keesiemeijer - I have shown Y with the following:

    <?php
    	$postsInCat = get_term_by('name','painting','category');
    	$postsInCat = $postsInCat->count;
    	echo $postsInCat;
    	?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.