[phpBB Debug] PHP Warning: in file [ROOT]/ext/sniper/mobiledevice/event/listener.php on line 194: Trying to access array offset on false
[phpBB Debug] PHP Warning: in file [ROOT]/ext/sniper/mobiledevice/event/listener.php on line 199: Trying to access array offset on false
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4191: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4191: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4191: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4191: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3076)
BitArena • Shortcodes with Attributes
Page 1 of 1

Shortcodes with Attributes

Posted: 27 Dec 2024, 13:49
by Kygo
To create a shortcode for links, we need to include the attribute information as well as the anchor text for the link itself. We can do this by placing this function in your theme’s file:hreffunctions.php
Please Login or Register to see this code Then, when creating a post, emulate the following format to include any links you wish:

[link href="https://perishablepress.com/"]Perishable Press[/link]

..which will output the following code:

<a href="https://perishablepress.com/">Perishable Press</a>

When the attribute is removed from the shortcode, the default URL will be used. You may specify the default URL in the third line of the funtion (see comment).href