Shortcode erstellen
< 1 min read
function budi_farbiger_text($atts, $content = null){
$atts = shortcode_atts([
'text' => '',
'color' => '#ff00ff',
], $atts);
ob_start();
?>
<p style="<?php echo $atts["color"]; ?>">
<?php echo $atts["text"]; ?>
</p>
<?php
$output = ob_get_contents();
ob_end_clean();
return $output;
}
// Shortcode hinzufügen
add_shortcode('farbiger-text', 'budi_default'); // [farbiger-text text="Titel" color="#ff00ff"]
Powered by BetterDocs