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

  • SEARCH
  • Home
  • 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 7772329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:51:51+00:00 2026-06-01T16:51:51+00:00

I am creating wordpress theme option panel and want to use some icons. I

  • 0

I am creating wordpress theme option panel and want to use some icons. I have one directory dedicated for icon into my theme folder. What I want to do is if user add any new image into that folder it will automatic appear into dropdown selection list into theme option panel.

Is there any way to do this in PHP with WordPress? I believe that is possible as I saw one theme has the same option but it was so complex so couldn’t figured out that and don’t remember theme name too now.

I have to use it with below type of code

$video_tax = array(-1 => 'Choose a category');
$video_terms = get_terms('video_category');
if ($video_terms) {
    foreach ($video_terms as $video_term) {
        $video_tax[$video_term->term_id] = $video_term->name;
    }
}
  • 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-06-01T16:51:52+00:00Added an answer on June 1, 2026 at 4:51 pm

    You might want to start by having a look at scandir. This will list all the contents of a folder on your system. From there it would just be a matter of putting the correct path, url or whatever you want in the the value of your options.

    EDIT: Here’s some sample code from one of my plugins:

    function icons_meta(){
        global $post;
        $custom = get_post_custom($post->ID);
        $link = $custom["icon"][0];
        $files = scandir(PATH."/icons");
        $selected = '';
    
        echo "<select name='icon'>";
        foreach($files as $file){
            if($file == $link){ 
                $selected = 'selected="selected"';
            } else {
                $selected = '';
            }
            echo "<option value='$file' $selected>".$file."</option>";
        }
        echo "</select>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a slideshow shortcode for my Wordpress theme, but have run into
I am creating a WP-theme, and run into a problem. I want to have
I am creating my first wordpress plugin. one of the questions i have is
I have 2 custom fields in my WordPress system when creating new posts. One
I'm creating a customized WordPress theme based on an existing site. I want to
Hi I am creating a wordpress custom page theme, I have included the code.
I'm creating a WordPress theme, and I'm wondering why I should even use a
Simple question. I'm creating a wordpress theme and I want to display the post
I am creating a wordpress theme for a record label. One aspect is the
I'm currently creating a Wordpress theme and I have an area which displays the

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.