Ein Shortcode könnte so aussehen:
PHP
// Add Shortcode
function se_mylink( $atts , $content = null ) {
// Attributes
$atts = shortcode_atts(
array(
'link' => 'https://www.example.com',
),
$atts,
'mylink'
);
return '<a href="' . $atts['link'] . '">' . $content . '</a>';
}
add_shortcode( 'mylink', 'se_mylink' );
Alles anzeigen
Das gehört in die functions.php des Child-Themes. Dann brauchst du in der Seite / im Beitrag nur noch folgendes eingeben: