WordPress.org

Ready to get started?Download WordPress

Forums

add custom taxonomy names in theme admin panel (2 posts)

  1. SuperMario290
    Member
    Posted 3 years ago #

    so I came up with a brilliant idea that in the new admin panel I'm adding to all of my themes, that users could add the name of custom taxonomies so that they can use them in their theme. well, I've been kind of having some trouble with this.

    So the code for the actual option is:

    array( "name" => "Custom Taxonomy 1",
    	"desc" => "Enter the name you would like for your custom taxonomy",
    	"id" => $shortname."_taxonomy1",
    	"type" => "text",
    	"std" => ""),

    then the code you have in the functions.php file would be:

    register_taxonomy('test', 'post', array(
    'hierarchical' => false,  'label' => 'test',
    'query_var' => true, 'rewrite' => true));

    but how could I actually call it in the function to make it so the taxonomy has the name specified by the user? I mean you can't do

    <?php echo get_option('spress_taxonomy1'); ?>

    can you? Can anybody help me?

  2. chinmoy
    Member
    Posted 3 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic