Bump. Anyone have some insight?
Yes it is possible to use shortcuts to create anchors. Here’s a simple example
function my_anchor( $atts ) {
return '<div id="myanchor"></div>';
}
add_shortcode( 'anchor', 'my_anchor' );
function my_toanchor( $atts ) {
return '<a href="#myanchor">To the Anchor</a>';
}
add_shortcode( 'toanchor', 'my_toanchor' );
The id on the div is the anchor, the hashtag goes toit.
/peter
Hi Peter– I’d like to use anchors within shortCODES not use shortCUTS to create anchors 🙂
Anchors aren’t working within shortcodes, so any content I place in one tab of a tab-creating shortcode cannot be anchored to another tab.
What I showed was how to create a short code that uses anchors. Are you creating the short code or just using one that someone else programmed?
/peter
I’m using a shortcode that someone else programmed. It is #4 on this page, “Tabbed Content”…
http://www.elegantthemes.com/preview/TheProfessional/shortcodes/#tabs
When I try to use anchors in between tabs, it doesn’t work.
Zenkamal,
Did you ever figure this out?
I’m using the same theme and would like to use anchors in short codes.