• Hi everyone!
    I would like to display the individual post / entry number with each post.

    I could use the post ID, but that’s not what I want to do since if you make a post and then delete it, the new one will have effectively skipped one number.

    I found the following thread: Add post number (count) to individual post? but this doesn’t help me because the only thing that plugin does it list the total amount of posts. I want each post to get it’s individual post number.

    Does anyone know of a plugin that does this?

    Thanks for reading!

    – J

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter pu2

    (@pu2)

    Is bumping allowed? ??

    After 24 hours. ??

    The issue though is the post numbers are not one right after another. You have the situation like you mention with deleted posts. You also have the issue with uploads as they get assigned post numbers. Pages as well.

    Really can’t think of anything right off.

    Thread Starter pu2

    (@pu2)

    Puh ??
    There’s no way just to have a script that counts through the database and distinguish / identify posts that are published?

    Thread Starter pu2

    (@pu2)

    Feels like a broken record, but: Doesn’t anyone know? I just switched from Movable Type, and I remember I had a plugin that was pretty simple, just a .pl file that counted through the database for posted topics and assigned numbers:

    # entrynumber.pl - Entry numbering plugin by Lummox JR
    # Designed to replace EntryID for permalinks so blogs survive import/export intact
    
    package LummoxJR::entrynumber;
    
    use MT::Template::Context;
    use MT::Entry;
    
    MT::Template::Context->add_tag(EntryNumber => \&entrynumber);
    
    my $entryN={};
    
    sub entrynumber {
    	my($ctx,$args)=@_;
    	my $tag=$ctx->stash('tag');
    	my $entry=$ctx->stash('entry');
    	return $ctx->error(MT->translate("An entry context is required in [_1]", "<MT$tag>"))
    		unless $entry && $entry->id;
    	my $form=$args->{author}?'author':'';
    	$entryN->{$form}=$entryN->{$form} || {};
    	my $cache=$entryN->{$form};
    	my $count;
    	unless($count=$cache->{$entry->id}) {
    		my %terms = ( blog_id => $entry->blog_id, status => MT::Entry::RELEASE() );
    		$terms{author_id}=$entry->author_id if($args->{author});
    		my $iter=MT::Entry->load_iter(\%terms, {sort => 'created_on', direction => 'ascend'});
    		my($e,$n);
    		while($e=$iter->()) {$cache->{$e->id}=++$n;}
    		$count=$cache->{$entry->id};
    		}
    	$args->{pad} ? (sprintf "%06d", $count) : "$count";
    }
    1;

    and posting perl wont get you anywhere, we use php here.

    If you want to cycle through the db and count posts, do that. its just a simple sql query.

    Thread Starter pu2

    (@pu2)

    whooami, I know WordPress is php, I just posted that to illustrate what I wanted to get done. And I’m sorry, but “just a simple sql query” to me reads like “gresche be sql delorim” — plainly, I have no clue how to do that :). I posted here to get some community help.

    mt dews’ plugin is just the simple query thats that shows the total number of posts. the OP wants the ordinal post number for each post.

    The best answer is in this thread by otto:

    https://www.ads-software.com/support/topic/97142?replies=5#post-484826

    Oh yes, sorry I must have got sidetracked in my quest for the answer ??

    sorry

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘How do I display the individual post’s number without using post id ?’ is closed to new replies.