Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 227839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:37:55+00:00 2026-05-11T19:37:55+00:00

I am building my first wordpress theme and was hoping that when the user

  • 0

I am building my first wordpress theme and was hoping that when the user made a new category, there was a way of automatically generating a thumbnail for it from the first image uploaded as a post to this category (it is a portfolio theme).

Does anyone know how this might be coded?

It cannot rely on hard coding as the user does not know how to do this and I cannot do it for every category they make.

Any pointers for code or even plug-ins would be grerat.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T19:37:55+00:00Added an answer on May 11, 2026 at 7:37 pm

    Hook onto an appropriate action such as publish_post so that, when a new post is created and sent out to the world, you scour the HTML for image tags. If the post’s category does not already have a thumbnail associated, use an image from this post to create a thumbnail and associate it with the category. If you only want this to occur for new categories and not existing categories, track which categories were already present when the plugin was installed.

    You could use WordPress’ existing media infrastructure to store the thumbnail and the wp_postmeta table to track your category-thumbnail associations. PHP comes with a library for image manipulation, and HTML scouring would be done with string manipulation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building out my first WordPress site for a client. I really want
I'm building a Wordpress theme, and I have these snippets in my style.css: #content
I'm building my first application that requires a calendar. I have it working great
Im building my first Windows Service. It's a component that connects to a mailbox
I'm busy building my first MVC app that uses the Telerik MVC components. Their
I'm building an iPhone app that, in part, allows the user to log in
Im building my first application using CodeIgniter, i need a bit of advice. There
I'm building my first django app. I have a user, and the user has
I'm building my first ASP.NET MVC application and I am having some troubles with
I am building my first ASP.Net MVC based app and have a problem accessing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.