Thankyour for the reply.
I guess the steps I have at the moment are:
1. show the tags in a dropdown with the corresponding tag as the selected option (ie- if first tag show the tag dropdown list with tag1 selected, and if there is a second,third or fourth tag, show each of them in a dropdown list with corresponding tag selected).
2. if a change is made to the tags selection, then update this to the DB to save the value.
3. be able to add a new dropdown with the tags if the user would like to add another tag, upto a maximum of 5.
So if I were to focus on step 1, here is my current code:
// CUSTOM GET FOR TAGS
if(isset($_GET['eid']) && $field['name'] == "tags")
{
$tags="";
$alltags = get_tags();
$posttags = get_the_tags($_GET['eid']);
foreach($posttags as $tag){
$selectedtag = $tag->name;}
echo '<div class="tagsdrop">';
if ($alltags)
{
if ($posttags > 0)
{
foreach($posttags as $tag)
{
echo " tag is: " . $tag->name ;
echo ''; foreach($alltags as $tag) { if($tag->name == $selectedtag) { echo ''.$tag->name.''; } else { echo ''.$tag->name.''; } } echo ' ';
}
}
}
echo '</div>'; //end tagsdrop
$FIELDVALUE = $tags;
}
elseif(isset($_POST['action']) && (isset($field['dataname']) && !isset($data[$field['dataname']]) ) && isset($_POST['form'][$field['name']]) ){
$FIELDVALUE = $_POST['form'][$field['name']];
}
elseif(isset($field['dataname']) && isset($data[$field['dataname']])){
$FIELDVALUE = $data[$field['dataname']];
}
I am editing a theme and have only added the code between "$alltags = get_tags();" and "echo '</div>'; //end tagsdrop".
Currently my output is 2 dropdown lists, as there are 2 tags on this particular post. Each dropdown lists all the tags, but the selected tag in both dropdowns is the 2nd tag alphabetically for the post. I am wanting tag 1 to be selected in the first tag dropdown, and tag 2 to be selected in the second tag dropdown.
Apologies again for the long winded explanation, I feel like my solution is close but just needs modifying by an expert.
Thankyou for your help.