• I have a category on my blog for quotes that I find interesting. I don’t give these posts titles, since the quotes are short and usually speak for themselves.

    However, I do want to number them. Ideally, the title of the post would be something like “Quote #7”. And then, the next quote that I add would be “Quote #8”. And so on.

    I was thinking I could do this one of three ways:

    1. Full Automation: WordPress counts the number of posts in the category to which I’m posting and, if the title is left blank, it assigns the category count plus one to the title.

    2. Half Automation: WordPress shows the number of posts in the category next to each category on the New Post page. When I make a new post, I check how many posts are in the category and add the title myself.

    3. Full Manual: I do all the counting myself and assign the title myself.

    If anyone could shed some light on how to accomplish this, I’d appreciate it. My searches for plugins or related tweaks are fruitless so far. But I’ll keep trying.

    Thanks for your time.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Forget Option 1 ??
    You can always do Option 3 ??

    Re: Option 2
    If you display your posts in the order of newest to oldest, what kind of number scheme are you expecting?

    So the posts are going to be intermingled with other posts from other categories on your posts page?

    Is it a problem if the number for a post changes?

    Could you use the post ID as part of the title, meaning the title wouldn’t change, but it wouldn’t necssarily be sequential. Look at the wp_posts table before you answer that…

    Thread Starter sumeetjain

    (@sumeetjain)

    Thanks for the prompt reply, MichaelH.

    To answer your questions, I think first a quick look at how the site works now is in order:

    https://sumeetjain.com/files/post-title.png (Visions is a category that doesn’t use post titles.)

    So right now, I’m using the post ID instead of the title (for posts within certain categories).

    The ideal solution with Option 2 would be a display of the number of posts in Visions, so I can manually add a post title. I have no where near 601 visions (as my site would currently have you believe).

    Posts are indeed intermingled with other posts from other categories.

    It isn’t a problem if the number for a post changes – as long as that doesn’t result in duplicate titles. However, I’m unclear as to how a post number would change. I never pre-date posts.

    One thought I had was something like a plugin for the admin screen to make a new post. Next to the categories in the selection box, have the number of posts in parentheses. How feasible is that?

    Thanks again for the quick reply.

    PS – “If you display your posts in the order of newest to oldest, what kind of number scheme are you expecting?” I didn’t quite understand the question.

    Post ID are not sequential in nature because revisions and attachments also are kept in the posts table.

    So, if you are trying to put a sequential number like 1,2,3,4…601 then that will need to be done by some counter in the scripts that display your posts or you need to manually assign.

    If displayed by a script, then if you display 601 posts in your visions category, what date order do you display the posts (oldest-to-newest or newest-to-oldest? Based on that answer which post get assigned 1, and which post gets assigned 601? And if you do insert a post dated March 5, 2007, posts could be assigned a new number.

    Thread Starter sumeetjain

    (@sumeetjain)

    Thanks for the clarification.

    I think the solution is just to count how many posts have status “Published” and then display that number next to each category on the ‘Add New Post’ page. Do you have any thoughts on the best way to accomplish that?

    Thanks for all your help.

    Don’t know if there’s a plugin that will help you with that. In lieu of that, start your post editing at the Posts->Categories screen to see the count of posts for that given category.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Assign the Category Count as the Actual Post Title’ is closed to new replies.