Wie konvertiert man diese Liste von Optionen von Radiobuttons zu einem Dropdown-Menü? Unten ist Code aus der single-product.php Vorlage gezogen.Wordpress - Abonnieren Sie alle Dinge: Konvertieren Radio-Buttons in das Dropdown-Menü
<div class="wcsatt-options-wrapper" <?php echo count($options) === 1 ? 'style="display:none;"' : '' ?>><?php
if ($prompt) {
echo $prompt;
} else {
?><h3><?php
_e('Choose a subscription plan:', WCS_ATT::TEXT_DOMAIN);
?></h3><?php
}
?><ul class="wcsatt-options-product"><?php
foreach ($options as $option_id => $option) {
?><li class="<?php echo $option_id !== '0' ? 'subscription-option' : 'one-time-option'; ?>">
<label>
<input type="radio" name="convert_to_sub_<?php echo $product->id; ?>" data-custom_data="<?php echo esc_attr(json_encode($option[ 'data' ])); ?>" value="<?php echo $option_id; ?>" <?php checked($option[ 'selected' ], true, true); ?> />
<?php echo $option[ 'description' ]; ?>
</label>
</li><?php
}
?></ul>
Was haben Sie bisher versucht? –
@WillBarnwell '
Php \t \t foreach ($ Optionen wie $ option_id => $ option) { \t \t \t?>- \t \t \t \t \t \t \t
php \t \t} \t?>
' –Ergebnis: https://1drv.ms/i/s!An0bZeoo150Bh-k4pzjmNyxKYP5trQ –