Create a custom shortcode for WordPress
// Create Shortcode knapp
// Shortcode: [knapp tittel="" link=""]
function tws_create_knapp_shortcode($atts) {
$atts = shortcode_atts(
array(
'tittel' => '',
'link' => '',
),
$atts,
'knapp'
);
$tittel = $atts['tittel'];
$link = $atts['link'];
return '<a href="' . $link . '" target="blank">' . $tittel . '</a>';
}
add_shortcode( 'knapp', 'tws_create_knapp_shortcode' );