Answer the question
In order to leave comments, you need to log in
How to make a shortcode to display a link to the current category in the middle of an article?
What needs to be written in function.php to display the text in the post in this form?
<a href="Линк на категорию"/> Название категории </a>
function cwc_donate_shortcode1( $atts ) {
extract(shortcode_atts(array(
'text' => 'Этот текст выведется на странице поста',
'account' => 'REPLACE ME',
'for' => 'Habr',
), $atts));
global $post;
if (!$for) $for = str_replace(" ","+",$post->post_title);
return '';
}
add_shortcode('donate1', 'cwc_donate_shortcode1');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question