Forums

Results Page: Numbered Entries (6 posts)

  1. revlimiter
    Member
    Posted 8 months ago #

    When I click a category on my blog such as "general" it comes up with the following:

    http://www.kimstewart.ca/blog/category/general/

    This is great, except each of the entries are labeled as "1"

    Does anybody know a fix for this?
    And getting the top to display

    16 Entries Tagged as "General"
    instead of
    Entries Tagged as "General"

    would also be great.

    Thanks!

  2. stvwlf
    Member
    Posted 8 months ago #

    Hi

    One thing at a time...

    More than likely there is a counter set up in your WP loop, and the counter is not incrementing with each post. Would be good if you post your index.php code.

    Use a pastebin instead of pasting it all in here
    http://wordpress.pastebin.ca/
    - post the link to the pastebin UL

  3. revlimiter
    Member
    Posted 8 months ago #

    hey,
    thanks stvwlf

    i have uploaded my search.php code from my themes folder
    http://wordpress.pastebin.ca/1365346

    hopefully this will give some insight on the loop issue

    thanks!

  4. stvwlf
    Member
    Posted 8 months ago #

    Hi

    I looked at your code and it looked fine to me. I got it running on a test site and sure enough the ten posts were numbered 1 through 10.

    Also the code you sent only allows ten posts per page. So if you are seeing 16 posts on one page all number one, the code that is running does not seem to be the same code you sent.

    A possible exception to that is this line of code
    <?php if (is_type_page()) continue; ?>
    which is the 1st line of code in the WP loop. I don't have that function here so couldn't run it. You should check out what designates a page as is_type_page - this code is skipping over any posts that meet that logic.

    So most likely either there is a problem with that logic, or is it possible there is a different version of the code you sent me that runs on another template page?

    Just before the end of the loop is this code

    <?php $postnum++; ?>
    <?php endwhile; ?>

    That $postnum++ is what adds one to the counter each time the loop processes a post. If that line is missing from a template the counter will never increment.

  5. revlimiter
    Member
    Posted 8 months ago #

    Thanks, stvwlf!

    I will try to find this "is_type_page" function and let you know.

    For the counter at the top of the page ("3 results found") it is using the results count plugin:
    http://wordpress.org/extend/plugins/results-count/

  6. revlimiter
    Member
    Posted 8 months ago #

    I found this in my functions.php page:

    function is_type_page() { // Check if the current post is a page
    	global $post;
    
    	if ($post->post_type == 'page') {
    		return true;
    	} else {
    		return false;
    	}
    }

    does it help?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.